regerated and working on publishing

This commit is contained in:
Luke Hagar
2024-09-08 02:40:34 +00:00
parent 02ce124a6b
commit ac5716c20d
1312 changed files with 65980 additions and 37728 deletions

View File

@@ -0,0 +1,311 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.CancelServerActivitiesResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequest;
import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequestBuilder;
import dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse;
import dev.plexapi.sdk.models.operations.GetServerActivitiesRequestBuilder;
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetServerActivitiesRequestBuilder getServerActivities() {
return new GetServerActivitiesRequestBuilder(this);
}
/**
* Get Server Activities
* Get Server Activities
* @return The response from the API call
* @throws Exception if the API call fails
*/
public 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetServerActivitiesResponse.Builder _resBuilder =
GetServerActivitiesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetServerActivitiesResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetServerActivitiesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetServerActivitiesResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetServerActivitiesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetServerActivitiesResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Cancel Server Activities
* Cancel Server Activities
* @return The call builder
*/
public CancelServerActivitiesRequestBuilder cancelServerActivities() {
return new 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 CancelServerActivitiesResponse cancelServerActivities(
String activityUUID) throws Exception {
CancelServerActivitiesRequest request =
CancelServerActivitiesRequest
.builder()
.activityUUID(activityUUID)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
CancelServerActivitiesResponse.Builder _resBuilder =
CancelServerActivitiesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
CancelServerActivitiesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<CancelServerActivitiesResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,684 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationResponseBody;
import dev.plexapi.sdk.models.errors.GetTransientTokenResponseBody;
import dev.plexapi.sdk.models.errors.GetUserDetailsResponseBody;
import dev.plexapi.sdk.models.errors.PostUsersSignInDataResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequest;
import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequestBuilder;
import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse;
import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType;
import dev.plexapi.sdk.models.operations.GetTransientTokenRequest;
import dev.plexapi.sdk.models.operations.GetTransientTokenRequestBuilder;
import dev.plexapi.sdk.models.operations.GetTransientTokenResponse;
import dev.plexapi.sdk.models.operations.GetUserDetailsRequest;
import dev.plexapi.sdk.models.operations.GetUserDetailsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetUserDetailsResponse;
import dev.plexapi.sdk.models.operations.GetUserDetailsUserPlexAccount;
import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest;
import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBody;
import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBuilder;
import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse;
import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.Scope;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.SerializedBody;
import dev.plexapi.sdk.utils.Utils.JsonShape;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.Object;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
/**
* API Calls regarding authentication for Plex Media Server
*
*/
public class Authentication implements
MethodCallGetTransientToken,
MethodCallGetSourceConnectionInformation,
MethodCallGetUserDetails,
MethodCallPostUsersSignInData {
/**
* GET_USER_DETAILS_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_USER_DETAILS_SERVERS = {
"https://plex.tv/api/v2",
};
/**
* POST_USERS_SIGN_IN_DATA_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] POST_USERS_SIGN_IN_DATA_SERVERS = {
"https://plex.tv/api/v2",
};
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 GetTransientTokenRequestBuilder getTransientToken() {
return new 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 GetTransientTokenResponse getTransientToken(
GetTransientTokenQueryParamType type,
Scope scope) throws Exception {
GetTransientTokenRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetTransientTokenResponse.Builder _resBuilder =
GetTransientTokenResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetTransientTokenResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetTransientTokenResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 GetSourceConnectionInformationRequestBuilder getSourceConnectionInformation() {
return new 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 GetSourceConnectionInformationResponse getSourceConnectionInformation(
String source) throws Exception {
GetSourceConnectionInformationRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetSourceConnectionInformationResponse.Builder _resBuilder =
GetSourceConnectionInformationResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetSourceConnectionInformationResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetSourceConnectionInformationResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get User Data By Token
* Get the User data from the provided X-Plex-Token
* @return The call builder
*/
public GetUserDetailsRequestBuilder getUserDetails() {
return new GetUserDetailsRequestBuilder(this);
}
/**
* Get User Data By Token
* Get the User data from the provided X-Plex-Token
* @param xPlexToken Plex Authentication Token
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetUserDetailsResponse getUserDetails(
String xPlexToken) throws Exception {
return getUserDetails(xPlexToken, Optional.empty());
}
/**
* Get User Data By Token
* Get the User data from the provided X-Plex-Token
* @param xPlexToken Plex Authentication Token
* @param serverURL Overrides the server URL.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetUserDetailsResponse getUserDetails(
String xPlexToken,
Optional<String> serverURL) throws Exception {
GetUserDetailsRequest request =
GetUserDetailsRequest
.builder()
.xPlexToken(xPlexToken)
.build();
String _baseUrl = Utils.templateUrl(GET_USER_DETAILS_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
}
String _url = Utils.generateURL(
_baseUrl,
"/user");
HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
GetUserDetailsRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getUserDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUserDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getUserDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUserDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetUserDetailsResponse.Builder _resBuilder =
GetUserDetailsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetUserDetailsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetUserDetailsUserPlexAccount _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetUserDetailsUserPlexAccount>() {});
_res.withUserPlexAccount(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetUserDetailsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetUserDetailsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get User SignIn Data
* Sign in user with username and password and return user data with Plex authentication token
* @return The call builder
*/
public PostUsersSignInDataRequestBuilder postUsersSignInData() {
return new PostUsersSignInDataRequestBuilder(this);
}
/**
* Get User SignIn Data
* Sign in user with username and password and return user data with Plex authentication token
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostUsersSignInDataResponse postUsersSignInDataDirect() throws Exception {
return postUsersSignInData(Optional.empty(), Optional.empty(), Optional.empty());
}
/**
* Get User SignIn Data
* Sign in user with username and password and return user data with Plex authentication token
* @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 requestBody Login credentials
* @param serverURL Overrides the server URL.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostUsersSignInDataResponse postUsersSignInData(
Optional<String> xPlexClientIdentifier,
Optional<? extends PostUsersSignInDataRequestBody> requestBody,
Optional<String> serverURL) throws Exception {
PostUsersSignInDataRequest request =
PostUsersSignInDataRequest
.builder()
.xPlexClientIdentifier(xPlexClientIdentifier)
.requestBody(requestBody)
.build();
String _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
}
String _url = Utils.generateURL(
_baseUrl,
"/users/signin");
HTTPRequest _req = new HTTPRequest(_url, "POST");
Object _convertedRequest = Utils.convertToShape(
request,
JsonShape.DEFAULT,
new TypeReference<Object>() {});
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
_convertedRequest,
"requestBody",
"form",
false);
_req.setBody(Optional.ofNullable(_serializedRequestBody));
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
PostUsersSignInDataRequest.class,
request,
this.sdkConfiguration.globals));
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
PostUsersSignInDataResponse.Builder _resBuilder =
PostUsersSignInDataResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
PostUsersSignInDataResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "201")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
PostUsersSignInDataUserPlexAccount _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<PostUsersSignInDataUserPlexAccount>() {});
_res.withUserPlexAccount(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
PostUsersSignInDataResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<PostUsersSignInDataResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,714 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.errors.StartAllTasksResponseBody;
import dev.plexapi.sdk.models.errors.StartTaskResponseBody;
import dev.plexapi.sdk.models.errors.StopAllTasksResponseBody;
import dev.plexapi.sdk.models.errors.StopTaskResponseBody;
import dev.plexapi.sdk.models.operations.GetButlerTasksRequestBuilder;
import dev.plexapi.sdk.models.operations.GetButlerTasksResponse;
import dev.plexapi.sdk.models.operations.GetButlerTasksResponseBody;
import dev.plexapi.sdk.models.operations.PathParamTaskName;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.StartAllTasksRequestBuilder;
import dev.plexapi.sdk.models.operations.StartAllTasksResponse;
import dev.plexapi.sdk.models.operations.StartTaskRequest;
import dev.plexapi.sdk.models.operations.StartTaskRequestBuilder;
import dev.plexapi.sdk.models.operations.StartTaskResponse;
import dev.plexapi.sdk.models.operations.StopAllTasksRequestBuilder;
import dev.plexapi.sdk.models.operations.StopAllTasksResponse;
import dev.plexapi.sdk.models.operations.StopTaskRequest;
import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder;
import dev.plexapi.sdk.models.operations.StopTaskResponse;
import dev.plexapi.sdk.models.operations.TaskName;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetButlerTasksRequestBuilder getButlerTasks() {
return new 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 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetButlerTasksResponse.Builder _resBuilder =
GetButlerTasksResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetButlerTasksResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetButlerTasksResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetButlerTasksResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetButlerTasksResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetButlerTasksResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 StartAllTasksRequestBuilder startAllTasks() {
return new 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 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
StartAllTasksResponse.Builder _resBuilder =
StartAllTasksResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
StartAllTasksResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<StartAllTasksResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 StopAllTasksRequestBuilder stopAllTasks() {
return new 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 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
StopAllTasksResponse.Builder _resBuilder =
StopAllTasksResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
StopAllTasksResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<StopAllTasksResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 StartTaskRequestBuilder startTask() {
return new 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 StartTaskResponse startTask(
TaskName taskName) throws Exception {
StartTaskRequest request =
StartTaskRequest
.builder()
.taskName(taskName)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
StartTaskResponse.Builder _resBuilder =
StartTaskResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
StartTaskResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<StartTaskResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 StopTaskRequestBuilder stopTask() {
return new 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 StopTaskResponse stopTask(
PathParamTaskName taskName) throws Exception {
StopTaskRequest request =
StopTaskRequest
.builder()
.taskName(taskName)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
StopTaskResponse.Builder _resBuilder =
StopTaskResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
StopTaskResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<StopTaskResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,372 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.GetGlobalHubsRequest;
import dev.plexapi.sdk.models.operations.GetGlobalHubsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse;
import dev.plexapi.sdk.models.operations.GetGlobalHubsResponseBody;
import dev.plexapi.sdk.models.operations.GetLibraryHubsRequest;
import dev.plexapi.sdk.models.operations.GetLibraryHubsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse;
import dev.plexapi.sdk.models.operations.GetLibraryHubsResponseBody;
import dev.plexapi.sdk.models.operations.OnlyTransient;
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Double;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetGlobalHubsRequestBuilder getGlobalHubs() {
return new 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 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 GetGlobalHubsResponse getGlobalHubs(
Optional<Double> count,
Optional<? extends OnlyTransient> onlyTransient) throws Exception {
GetGlobalHubsRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetGlobalHubsResponse.Builder _resBuilder =
GetGlobalHubsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetGlobalHubsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetGlobalHubsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetGlobalHubsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetGlobalHubsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetGlobalHubsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get library specific hubs
* This endpoint will return a list of library specific hubs
*
* @return The call builder
*/
public GetLibraryHubsRequestBuilder getLibraryHubs() {
return new 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 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 GetLibraryHubsResponse getLibraryHubs(
double sectionId,
Optional<Double> count,
Optional<? extends QueryParamOnlyTransient> onlyTransient) throws Exception {
GetLibraryHubsRequest request =
GetLibraryHubsRequest
.builder()
.sectionId(sectionId)
.count(count)
.onlyTransient(onlyTransient)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetLibraryHubsResponse.Builder _resBuilder =
GetLibraryHubsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetLibraryHubsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetLibraryHubsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetLibraryHubsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetLibraryHubsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetLibraryHubsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,498 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.EnablePaperTrailResponseBody;
import dev.plexapi.sdk.models.errors.LogLineResponseBody;
import dev.plexapi.sdk.models.errors.LogMultiLineResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.EnablePaperTrailRequestBuilder;
import dev.plexapi.sdk.models.operations.EnablePaperTrailResponse;
import dev.plexapi.sdk.models.operations.Level;
import dev.plexapi.sdk.models.operations.LogLineRequest;
import dev.plexapi.sdk.models.operations.LogLineRequestBuilder;
import dev.plexapi.sdk.models.operations.LogLineResponse;
import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder;
import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.SerializedBody;
import dev.plexapi.sdk.utils.Utils.JsonShape;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.Object;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 LogLineRequestBuilder logLine() {
return new 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 LogLineResponse logLine(
Level level,
String message,
String source) throws Exception {
LogLineRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
LogLineResponse.Builder _resBuilder =
LogLineResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
LogLineResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<LogLineResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 LogMultiLineRequestBuilder logMultiLine() {
return new 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 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,
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
LogMultiLineResponse.Builder _resBuilder =
LogMultiLineResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
LogMultiLineResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<LogMultiLineResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 EnablePaperTrailRequestBuilder enablePaperTrail() {
return new 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 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
EnablePaperTrailResponse.Builder _resBuilder =
EnablePaperTrailResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
EnablePaperTrailResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<EnablePaperTrailResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,747 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.GetBannerImageResponseBody;
import dev.plexapi.sdk.models.errors.GetThumbImageResponseBody;
import dev.plexapi.sdk.models.errors.MarkPlayedResponseBody;
import dev.plexapi.sdk.models.errors.MarkUnplayedResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.errors.UpdatePlayProgressResponseBody;
import dev.plexapi.sdk.models.operations.GetBannerImageRequest;
import dev.plexapi.sdk.models.operations.GetBannerImageRequestBuilder;
import dev.plexapi.sdk.models.operations.GetBannerImageResponse;
import dev.plexapi.sdk.models.operations.GetThumbImageRequest;
import dev.plexapi.sdk.models.operations.GetThumbImageRequestBuilder;
import dev.plexapi.sdk.models.operations.GetThumbImageResponse;
import dev.plexapi.sdk.models.operations.MarkPlayedRequest;
import dev.plexapi.sdk.models.operations.MarkPlayedRequestBuilder;
import dev.plexapi.sdk.models.operations.MarkPlayedResponse;
import dev.plexapi.sdk.models.operations.MarkUnplayedRequest;
import dev.plexapi.sdk.models.operations.MarkUnplayedRequestBuilder;
import dev.plexapi.sdk.models.operations.MarkUnplayedResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest;
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder;
import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls interacting with Plex Media Server Media
*
*/
public class Media implements
MethodCallMarkPlayed,
MethodCallMarkUnplayed,
MethodCallUpdatePlayProgress,
MethodCallGetBannerImage,
MethodCallGetThumbImage {
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 MarkPlayedRequestBuilder markPlayed() {
return new 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 MarkPlayedResponse markPlayed(
double key) throws Exception {
MarkPlayedRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
MarkPlayedResponse.Builder _resBuilder =
MarkPlayedResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
MarkPlayedResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<MarkPlayedResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Mark Media Unplayed
* This will mark the provided media key as Unplayed.
* @return The call builder
*/
public MarkUnplayedRequestBuilder markUnplayed() {
return new 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 MarkUnplayedResponse markUnplayed(
double key) throws Exception {
MarkUnplayedRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
MarkUnplayedResponse.Builder _resBuilder =
MarkUnplayedResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
MarkUnplayedResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<MarkUnplayedResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Update Media Play Progress
* This API command can be used to update the play progress of a media item.
*
* @return The call builder
*/
public UpdatePlayProgressRequestBuilder updatePlayProgress() {
return new 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 UpdatePlayProgressResponse updatePlayProgress(
String key,
double time,
String state) throws Exception {
UpdatePlayProgressRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
UpdatePlayProgressResponse.Builder _resBuilder =
UpdatePlayProgressResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
UpdatePlayProgressResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<UpdatePlayProgressResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Banner Image
* Gets the banner image of the media item
* @return The call builder
*/
public GetBannerImageRequestBuilder getBannerImage() {
return new GetBannerImageRequestBuilder(this);
}
/**
* Get Banner Image
* Gets the banner image of the media item
* @param request The request object containing all of the parameters for the API call.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetBannerImageResponse getBannerImage(
GetBannerImageRequest request) throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
GetBannerImageRequest.class,
_baseUrl,
"/library/metadata/{ratingKey}/banner",
request, this.sdkConfiguration.globals);
HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "image/jpeg")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
GetBannerImageRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetBannerImageResponse.Builder _resBuilder =
GetBannerImageResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200") && Utils.contentTypeMatches(_contentType, "image/jpeg")) {
_resBuilder.responseStream(_httpRes.body());
}
GetBannerImageResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
_res.withHeaders(_httpRes.headers().map());
if (Utils.contentTypeMatches(_contentType, "image/jpeg")) {
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetBannerImageResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetBannerImageResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Thumb Image
* Gets the thumbnail image of the media item
* @return The call builder
*/
public GetThumbImageRequestBuilder getThumbImage() {
return new GetThumbImageRequestBuilder(this);
}
/**
* Get Thumb Image
* Gets the thumbnail image of the media item
* @param request The request object containing all of the parameters for the API call.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetThumbImageResponse getThumbImage(
GetThumbImageRequest request) throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
GetThumbImageRequest.class,
_baseUrl,
"/library/metadata/{ratingKey}/thumb",
request, this.sdkConfiguration.globals);
HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "image/jpeg")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
GetThumbImageRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetThumbImageResponse.Builder _resBuilder =
GetThumbImageResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200") && Utils.contentTypeMatches(_contentType, "image/jpeg")) {
_resBuilder.responseStream(_httpRes.body());
}
GetThumbImageResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
_res.withHeaders(_httpRes.headers().map());
if (Utils.contentTypeMatches(_contentType, "image/jpeg")) {
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetThumbImageResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetThumbImageResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,502 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.annotation.JsonValue;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.SpeakeasyHTTPClient;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
/**
* Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
*/
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;
/**
* API Calls that perform operations with Plex Media Server Watchlists
*
*/
private final Watchlist watchlist;
/**
* 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;
/**
* 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;
}
/**
* API Calls that perform operations with Plex Media Server Watchlists
*
*/
public Watchlist watchlist() {
return watchlist;
}
/**
* 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;
}
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(dev.plexapi.sdk.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, Map<String, String> params) {
this.sdkConfiguration.serverUrl = dev.plexapi.sdk.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 (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 (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 (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("queryParam")) {
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
}
this.sdkConfiguration.globals.get("parameters").get("queryParam").put("xPlexClientIdentifier", xPlexClientIdentifier);
return this;
}
// Visible for testing, will be accessed via reflection
void _hooks(dev.plexapi.sdk.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.watchlist = new Watchlist(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.sdkConfiguration.initialize();
}}

View File

@@ -0,0 +1,78 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import dev.plexapi.sdk.hooks.SDKHooks;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.Hook.SdkInitData;
import dev.plexapi.sdk.utils.Hooks;
import dev.plexapi.sdk.utils.RetryConfig;
import java.lang.Object;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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", "https");
put("ip", "10.10.10.47");
put("port", "32400");
} });
} };
public String language = "java";
public String openapiDocVersion = "0.0.3";
public String sdkVersion = "0.2.1";
public String genVersion = "2.411.9";
public String userAgent = "speakeasy-sdk/java 0.2.1 2.411.9 0.0.3 dev.plexapi.sdk";
private Hooks _hooks = createHooks();
private static Hooks createHooks() {
Hooks hooks = new Hooks();
return hooks;
}
public Hooks hooks() {
return _hooks;
}
public void setHooks(Hooks hooks) {
this._hooks = hooks;
}
/**
* Initializes state (for example hooks).
**/
public void initialize() {
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();
}
@SuppressWarnings("serial")
public Map<String, Map<String, Map<String,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

@@ -0,0 +1,545 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.PerformSearchResponseBody;
import dev.plexapi.sdk.models.errors.PerformVoiceSearchResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.GetSearchResultsRequest;
import dev.plexapi.sdk.models.operations.GetSearchResultsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetSearchResultsResponse;
import dev.plexapi.sdk.models.operations.GetSearchResultsResponseBody;
import dev.plexapi.sdk.models.operations.PerformSearchRequest;
import dev.plexapi.sdk.models.operations.PerformSearchRequestBuilder;
import dev.plexapi.sdk.models.operations.PerformSearchResponse;
import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest;
import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequestBuilder;
import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Double;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 PerformSearchRequestBuilder performSearch() {
return new 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 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 PerformSearchResponse performSearch(
String query,
Optional<Double> sectionId,
Optional<Double> limit) throws Exception {
PerformSearchRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"performSearch",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"performSearch",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"performSearch",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
PerformSearchResponse.Builder _resBuilder =
PerformSearchResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
PerformSearchResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<PerformSearchResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 PerformVoiceSearchRequestBuilder performVoiceSearch() {
return new 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 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 PerformVoiceSearchResponse performVoiceSearch(
String query,
Optional<Double> sectionId,
Optional<Double> limit) throws Exception {
PerformVoiceSearchRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"performVoiceSearch",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"performVoiceSearch",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"performVoiceSearch",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
PerformVoiceSearchResponse.Builder _resBuilder =
PerformVoiceSearchResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
PerformVoiceSearchResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<PerformVoiceSearchResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Search Results
* This will search the database for the string provided.
* @return The call builder
*/
public GetSearchResultsRequestBuilder getSearchResults() {
return new 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 GetSearchResultsResponse getSearchResults(
String query) throws Exception {
GetSearchResultsRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSearchResults",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getSearchResults",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSearchResults",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetSearchResultsResponse.Builder _resBuilder =
GetSearchResultsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetSearchResultsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetSearchResultsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetSearchResultsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetSearchResultsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetSearchResultsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,28 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import dev.plexapi.sdk.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;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,615 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.errors.StopTranscodeSessionResponseBody;
import dev.plexapi.sdk.models.operations.GetSessionHistoryRequest;
import dev.plexapi.sdk.models.operations.GetSessionHistoryRequestBuilder;
import dev.plexapi.sdk.models.operations.GetSessionHistoryResponse;
import dev.plexapi.sdk.models.operations.GetSessionHistoryResponseBody;
import dev.plexapi.sdk.models.operations.GetSessionsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetSessionsResponse;
import dev.plexapi.sdk.models.operations.GetSessionsResponseBody;
import dev.plexapi.sdk.models.operations.GetTranscodeSessionsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponse;
import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponseBody;
import dev.plexapi.sdk.models.operations.QueryParamFilter;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest;
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequestBuilder;
import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.Long;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetSessionsRequestBuilder getSessions() {
return new 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 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSessions",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getSessions",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSessions",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetSessionsResponse.Builder _resBuilder =
GetSessionsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetSessionsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetSessionsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetSessionsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetSessionsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetSessionsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Session History
* This will Retrieve a listing of all history views.
* @return The call builder
*/
public GetSessionHistoryRequestBuilder getSessionHistory() {
return new 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 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 GetSessionHistoryResponse getSessionHistory(
Optional<String> sort,
Optional<Long> accountId,
Optional<? extends QueryParamFilter> filter,
Optional<Long> librarySectionID) throws Exception {
GetSessionHistoryRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSessionHistory",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getSessionHistory",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSessionHistory",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetSessionHistoryResponse.Builder _resBuilder =
GetSessionHistoryResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetSessionHistoryResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetSessionHistoryResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetSessionHistoryResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetSessionHistoryResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetSessionHistoryResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Transcode Sessions
* Get Transcode Sessions
* @return The call builder
*/
public GetTranscodeSessionsRequestBuilder getTranscodeSessions() {
return new GetTranscodeSessionsRequestBuilder(this);
}
/**
* Get Transcode Sessions
* Get Transcode Sessions
* @return The response from the API call
* @throws Exception if the API call fails
*/
public 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTranscodeSessions",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTranscodeSessions",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTranscodeSessions",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetTranscodeSessionsResponse.Builder _resBuilder =
GetTranscodeSessionsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetTranscodeSessionsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetTranscodeSessionsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetTranscodeSessionsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Stop a Transcode Session
* Stop a Transcode Session
* @return The call builder
*/
public StopTranscodeSessionRequestBuilder stopTranscodeSession() {
return new 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 StopTranscodeSessionResponse stopTranscodeSession(
String sessionKey) throws Exception {
StopTranscodeSessionRequest request =
StopTranscodeSessionRequest
.builder()
.sessionKey(sessionKey)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTranscodeSession",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopTranscodeSession",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTranscodeSession",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
StopTranscodeSessionResponse.Builder _resBuilder =
StopTranscodeSessionResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
StopTranscodeSessionResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<StopTranscodeSessionResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,519 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequest;
import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponse;
import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponseBody;
import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequest;
import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponse;
import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponseBody;
import dev.plexapi.sdk.models.operations.GetStatisticsRequest;
import dev.plexapi.sdk.models.operations.GetStatisticsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetStatisticsResponse;
import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.Long;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetStatisticsRequestBuilder getStatistics() {
return new 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 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 GetStatisticsResponse getStatistics(
Optional<Long> timespan) throws Exception {
GetStatisticsRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetStatisticsResponse.Builder _resBuilder =
GetStatisticsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetStatisticsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetStatisticsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetStatisticsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetStatisticsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetStatisticsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Resources Statistics
* This will return the resources for the server
* @return The call builder
*/
public GetResourcesStatisticsRequestBuilder getResourcesStatistics() {
return new 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 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 GetResourcesStatisticsResponse getResourcesStatistics(
Optional<Long> timespan) throws Exception {
GetResourcesStatisticsRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getResourcesStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getResourcesStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getResourcesStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetResourcesStatisticsResponse.Builder _resBuilder =
GetResourcesStatisticsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetResourcesStatisticsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetResourcesStatisticsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetResourcesStatisticsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Bandwidth Statistics
* This will return the bandwidth statistics for the server
* @return The call builder
*/
public GetBandwidthStatisticsRequestBuilder getBandwidthStatistics() {
return new 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 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 GetBandwidthStatisticsResponse getBandwidthStatistics(
Optional<Long> timespan) throws Exception {
GetBandwidthStatisticsRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getBandwidthStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getBandwidthStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getBandwidthStatistics",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetBandwidthStatisticsResponse.Builder _resBuilder =
GetBandwidthStatisticsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetBandwidthStatisticsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetBandwidthStatisticsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetBandwidthStatisticsResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,476 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.ApplyUpdatesResponseBody;
import dev.plexapi.sdk.models.errors.CheckForUpdatesResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.ApplyUpdatesRequest;
import dev.plexapi.sdk.models.operations.ApplyUpdatesRequestBuilder;
import dev.plexapi.sdk.models.operations.ApplyUpdatesResponse;
import dev.plexapi.sdk.models.operations.CheckForUpdatesRequest;
import dev.plexapi.sdk.models.operations.CheckForUpdatesRequestBuilder;
import dev.plexapi.sdk.models.operations.CheckForUpdatesResponse;
import dev.plexapi.sdk.models.operations.Download;
import dev.plexapi.sdk.models.operations.GetUpdateStatusRequestBuilder;
import dev.plexapi.sdk.models.operations.GetUpdateStatusResponse;
import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.Skip;
import dev.plexapi.sdk.models.operations.Tonight;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetUpdateStatusRequestBuilder getUpdateStatus() {
return new 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 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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUpdateStatus",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getUpdateStatus",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUpdateStatus",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetUpdateStatusResponse.Builder _resBuilder =
GetUpdateStatusResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetUpdateStatusResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetUpdateStatusResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetUpdateStatusResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetUpdateStatusResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetUpdateStatusResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Checking for updates
* Checking for updates
* @return The call builder
*/
public CheckForUpdatesRequestBuilder checkForUpdates() {
return new CheckForUpdatesRequestBuilder(this);
}
/**
* Checking for updates
* Checking for updates
* @return The response from the API call
* @throws Exception if the API call fails
*/
public 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 CheckForUpdatesResponse checkForUpdates(
Optional<? extends Download> download) throws Exception {
CheckForUpdatesRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"checkForUpdates",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"checkForUpdates",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"checkForUpdates",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
CheckForUpdatesResponse.Builder _resBuilder =
CheckForUpdatesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
CheckForUpdatesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<CheckForUpdatesResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* 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 ApplyUpdatesRequestBuilder applyUpdates() {
return new 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 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 ApplyUpdatesResponse applyUpdates(
Optional<? extends Tonight> tonight,
Optional<? extends Skip> skip) throws Exception {
ApplyUpdatesRequest request =
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"applyUpdates",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"applyUpdates",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"applyUpdates",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
ApplyUpdatesResponse.Builder _resBuilder =
ApplyUpdatesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
ApplyUpdatesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<ApplyUpdatesResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,299 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.GetTimelineResponseBody;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.errors.StartUniversalTranscodeResponseBody;
import dev.plexapi.sdk.models.operations.GetTimelineRequest;
import dev.plexapi.sdk.models.operations.GetTimelineRequestBuilder;
import dev.plexapi.sdk.models.operations.GetTimelineResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequestBuilder;
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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 GetTimelineRequestBuilder getTimeline() {
return new 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 GetTimelineResponse getTimeline(
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTimeline",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTimeline",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTimeline",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetTimelineResponse.Builder _resBuilder =
GetTimelineResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetTimelineResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetTimelineResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Start Universal Transcode
* Begin a Universal Transcode Session
* @return The call builder
*/
public StartUniversalTranscodeRequestBuilder startUniversalTranscode() {
return new 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 StartUniversalTranscodeResponse startUniversalTranscode(
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(
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(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startUniversalTranscode",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startUniversalTranscode",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startUniversalTranscode",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
StartUniversalTranscodeResponse.Builder _resBuilder =
StartUniversalTranscodeResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
StartUniversalTranscodeResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<StartUniversalTranscodeResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,207 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.GetWatchListRequest;
import dev.plexapi.sdk.models.operations.GetWatchListRequestBuilder;
import dev.plexapi.sdk.models.operations.GetWatchListResponse;
import dev.plexapi.sdk.models.operations.GetWatchListResponseBody;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform operations with Plex Media Server Watchlists
*
*/
public class Watchlist implements
MethodCallGetWatchList {
/**
* GET_WATCH_LIST_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_WATCH_LIST_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 GetWatchListRequestBuilder getWatchList() {
return new 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 GetWatchListResponse getWatchList(
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 GetWatchListResponse getWatchList(
GetWatchListRequest request,
Optional<String> serverURL) throws Exception {
String _baseUrl = Utils.templateUrl(GET_WATCH_LIST_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
}
String _url = Utils.generateURL(
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(
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(
"get-watch-list",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-watch-list",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-watch-list",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-watch-list",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetWatchListResponse.Builder _resBuilder =
GetWatchListResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetWatchListResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetWatchListResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetWatchListResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
dev.plexapi.sdk.models.errors.GetWatchListResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<dev.plexapi.sdk.models.errors.GetWatchListResponseBody>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,26 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.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(dev.plexapi.sdk.utils.Hooks hooks) {
// register hooks here
// for more information see
// https://www.speakeasy.com/docs/additional-features/sdk-hooks
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class AddPlaylistContentsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public AddPlaylistContentsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(AddPlaylistContentsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public AddPlaylistContentsErrors build() {
return new AddPlaylistContentsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<AddPlaylistContentsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public AddPlaylistContentsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<AddPlaylistContentsErrors>> errors(){
return (Optional<List<AddPlaylistContentsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public AddPlaylistContentsResponseBody withErrors(List<AddPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public AddPlaylistContentsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(AddPlaylistContentsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<AddPlaylistContentsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<AddPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class ApplyUpdatesErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public ApplyUpdatesErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(ApplyUpdatesErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public ApplyUpdatesErrors build() {
return new ApplyUpdatesErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<ApplyUpdatesErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public ApplyUpdatesResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<ApplyUpdatesErrors>> errors(){
return (Optional<List<ApplyUpdatesErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public ApplyUpdatesResponseBody withErrors(List<ApplyUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public ApplyUpdatesResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(ApplyUpdatesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<ApplyUpdatesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<ApplyUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,33 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class CancelServerActivitiesErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public CancelServerActivitiesErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(CancelServerActivitiesErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public CancelServerActivitiesErrors build() {
return new CancelServerActivitiesErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<CancelServerActivitiesErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public CancelServerActivitiesResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<CancelServerActivitiesErrors>> errors(){
return (Optional<List<CancelServerActivitiesErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public CancelServerActivitiesResponseBody withErrors(List<CancelServerActivitiesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public CancelServerActivitiesResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(CancelServerActivitiesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<CancelServerActivitiesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<CancelServerActivitiesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class CheckForUpdatesErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public CheckForUpdatesErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(CheckForUpdatesErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public CheckForUpdatesErrors build() {
return new CheckForUpdatesErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<CheckForUpdatesErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public CheckForUpdatesResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<CheckForUpdatesErrors>> errors(){
return (Optional<List<CheckForUpdatesErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public CheckForUpdatesResponseBody withErrors(List<CheckForUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public CheckForUpdatesResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(CheckForUpdatesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<CheckForUpdatesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<CheckForUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class ClearPlaylistContentsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public ClearPlaylistContentsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(ClearPlaylistContentsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public ClearPlaylistContentsErrors build() {
return new ClearPlaylistContentsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<ClearPlaylistContentsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public ClearPlaylistContentsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<ClearPlaylistContentsErrors>> errors(){
return (Optional<List<ClearPlaylistContentsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public ClearPlaylistContentsResponseBody withErrors(List<ClearPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public ClearPlaylistContentsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(ClearPlaylistContentsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<ClearPlaylistContentsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<ClearPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class CreatePlaylistErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public CreatePlaylistErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(CreatePlaylistErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public CreatePlaylistErrors build() {
return new CreatePlaylistErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<CreatePlaylistErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public CreatePlaylistResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<CreatePlaylistErrors>> errors(){
return (Optional<List<CreatePlaylistErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public CreatePlaylistResponseBody withErrors(List<CreatePlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public CreatePlaylistResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(CreatePlaylistResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<CreatePlaylistErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<CreatePlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class DeleteLibraryErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public DeleteLibraryErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(DeleteLibraryErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public DeleteLibraryErrors build() {
return new DeleteLibraryErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<DeleteLibraryErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public DeleteLibraryResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<DeleteLibraryErrors>> errors(){
return (Optional<List<DeleteLibraryErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public DeleteLibraryResponseBody withErrors(List<DeleteLibraryErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public DeleteLibraryResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(DeleteLibraryResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<DeleteLibraryErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<DeleteLibraryErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class DeletePlaylistErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public DeletePlaylistErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(DeletePlaylistErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public DeletePlaylistErrors build() {
return new DeletePlaylistErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<DeletePlaylistErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public DeletePlaylistResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<DeletePlaylistErrors>> errors(){
return (Optional<List<DeletePlaylistErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public DeletePlaylistResponseBody withErrors(List<DeletePlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public DeletePlaylistResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(DeletePlaylistResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<DeletePlaylistErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<DeletePlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class EnablePaperTrailErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public EnablePaperTrailErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(EnablePaperTrailErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public EnablePaperTrailErrors build() {
return new EnablePaperTrailErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<EnablePaperTrailErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public EnablePaperTrailResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<EnablePaperTrailErrors>> errors(){
return (Optional<List<EnablePaperTrailErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public EnablePaperTrailResponseBody withErrors(List<EnablePaperTrailErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public EnablePaperTrailResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(EnablePaperTrailResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<EnablePaperTrailErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<EnablePaperTrailErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class Errors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public Errors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(Errors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public Errors build() {
return new Errors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetAllLibrariesErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetAllLibrariesErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetAllLibrariesErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetAllLibrariesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetAllLibrariesErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetAllLibrariesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetAllLibrariesErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetAllLibrariesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetAllLibrariesErrors withStatus(Optional<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;
}
GetAllLibrariesErrors other = (GetAllLibrariesErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetAllLibrariesErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetAllLibrariesErrors build() {
return new GetAllLibrariesErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetAllLibrariesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetAllLibrariesResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetAllLibrariesErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetAllLibrariesResponseBody(
@JsonProperty("errors") Optional<? extends List<GetAllLibrariesErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetAllLibrariesResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetAllLibrariesErrors>> errors(){
return (Optional<List<GetAllLibrariesErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetAllLibrariesResponseBody withErrors(List<GetAllLibrariesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetAllLibrariesResponseBody withErrors(Optional<? extends List<GetAllLibrariesErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetAllLibrariesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetAllLibrariesResponseBody 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;
}
GetAllLibrariesResponseBody other = (GetAllLibrariesResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetAllLibrariesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetAllLibrariesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetAllLibrariesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetAllLibrariesErrors>> 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 GetAllLibrariesResponseBody build() {
return new GetAllLibrariesResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetAvailableClientsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetAvailableClientsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetAvailableClientsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetAvailableClientsErrors build() {
return new GetAvailableClientsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetAvailableClientsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetAvailableClientsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetAvailableClientsErrors>> errors(){
return (Optional<List<GetAvailableClientsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetAvailableClientsResponseBody withErrors(List<GetAvailableClientsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetAvailableClientsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetAvailableClientsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetAvailableClientsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetAvailableClientsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetBandwidthStatisticsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetBandwidthStatisticsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetBandwidthStatisticsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetBandwidthStatisticsErrors build() {
return new GetBandwidthStatisticsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetBandwidthStatisticsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetBandwidthStatisticsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetBandwidthStatisticsErrors>> errors(){
return (Optional<List<GetBandwidthStatisticsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetBandwidthStatisticsResponseBody withErrors(List<GetBandwidthStatisticsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetBandwidthStatisticsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetBandwidthStatisticsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetBandwidthStatisticsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetBandwidthStatisticsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetBannerImageErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetBannerImageErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetBannerImageErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetBannerImageErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetBannerImageErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetBannerImageErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetBannerImageErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetBannerImageErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetBannerImageErrors withStatus(Optional<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;
}
GetBannerImageErrors other = (GetBannerImageErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetBannerImageErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetBannerImageErrors build() {
return new GetBannerImageErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetBannerImageResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetBannerImageResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetBannerImageErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetBannerImageResponseBody(
@JsonProperty("errors") Optional<? extends List<GetBannerImageErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetBannerImageResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetBannerImageErrors>> errors(){
return (Optional<List<GetBannerImageErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetBannerImageResponseBody withErrors(List<GetBannerImageErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetBannerImageResponseBody withErrors(Optional<? extends List<GetBannerImageErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetBannerImageResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetBannerImageResponseBody 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;
}
GetBannerImageResponseBody other = (GetBannerImageResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetBannerImageResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetBannerImageErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetBannerImageErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetBannerImageErrors>> 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 GetBannerImageResponseBody build() {
return new GetBannerImageResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetButlerTasksErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetButlerTasksErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetButlerTasksErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetButlerTasksErrors build() {
return new GetButlerTasksErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetButlerTasksErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetButlerTasksResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetButlerTasksErrors>> errors(){
return (Optional<List<GetButlerTasksErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetButlerTasksResponseBody withErrors(List<GetButlerTasksErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetButlerTasksResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetButlerTasksResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetButlerTasksErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetButlerTasksErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetCompanionsDataErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetCompanionsDataErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetCompanionsDataErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetCompanionsDataErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetCompanionsDataErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetCompanionsDataErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetCompanionsDataErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetCompanionsDataErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetCompanionsDataErrors withStatus(Optional<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;
}
GetCompanionsDataErrors other = (GetCompanionsDataErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetCompanionsDataErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetCompanionsDataErrors build() {
return new GetCompanionsDataErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetCompanionsDataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetCompanionsDataResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetCompanionsDataErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetCompanionsDataResponseBody(
@JsonProperty("errors") Optional<? extends List<GetCompanionsDataErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetCompanionsDataResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetCompanionsDataErrors>> errors(){
return (Optional<List<GetCompanionsDataErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetCompanionsDataResponseBody withErrors(List<GetCompanionsDataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetCompanionsDataResponseBody withErrors(Optional<? extends List<GetCompanionsDataErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetCompanionsDataResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetCompanionsDataResponseBody 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;
}
GetCompanionsDataResponseBody other = (GetCompanionsDataResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetCompanionsDataResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetCompanionsDataErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetCompanionsDataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetCompanionsDataErrors>> 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 GetCompanionsDataResponseBody build() {
return new GetCompanionsDataResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetDevicesErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetDevicesErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetDevicesErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetDevicesErrors build() {
return new GetDevicesErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetDevicesErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetDevicesResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetDevicesErrors>> errors(){
return (Optional<List<GetDevicesErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetDevicesResponseBody withErrors(List<GetDevicesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetDevicesResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetDevicesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetDevicesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetDevicesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetFileHashErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetFileHashErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetFileHashErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetFileHashErrors build() {
return new GetFileHashErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetFileHashErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetFileHashResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetFileHashErrors>> errors(){
return (Optional<List<GetFileHashErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetFileHashResponseBody withErrors(List<GetFileHashErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetFileHashResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetFileHashResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetFileHashErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetFileHashErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetGeoDataErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetGeoDataErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetGeoDataErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetGeoDataErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetGeoDataErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetGeoDataErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetGeoDataErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetGeoDataErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetGeoDataErrors withStatus(Optional<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;
}
GetGeoDataErrors other = (GetGeoDataErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetGeoDataErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetGeoDataErrors build() {
return new GetGeoDataErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetGeoDataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetGeoDataResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetGeoDataErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetGeoDataResponseBody(
@JsonProperty("errors") Optional<? extends List<GetGeoDataErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetGeoDataResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetGeoDataErrors>> errors(){
return (Optional<List<GetGeoDataErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetGeoDataResponseBody withErrors(List<GetGeoDataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetGeoDataResponseBody withErrors(Optional<? extends List<GetGeoDataErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetGeoDataResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetGeoDataResponseBody 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;
}
GetGeoDataResponseBody other = (GetGeoDataResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetGeoDataResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetGeoDataErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetGeoDataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetGeoDataErrors>> 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 GetGeoDataResponseBody build() {
return new GetGeoDataResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetGlobalHubsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetGlobalHubsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetGlobalHubsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetGlobalHubsErrors build() {
return new GetGlobalHubsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetGlobalHubsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetGlobalHubsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetGlobalHubsErrors>> errors(){
return (Optional<List<GetGlobalHubsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetGlobalHubsResponseBody withErrors(List<GetGlobalHubsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetGlobalHubsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetGlobalHubsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetGlobalHubsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetGlobalHubsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetHomeDataErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetHomeDataErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetHomeDataErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetHomeDataErrors build() {
return new GetHomeDataErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetHomeDataErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetHomeDataResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetHomeDataErrors>> errors(){
return (Optional<List<GetHomeDataErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetHomeDataResponseBody withErrors(List<GetHomeDataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetHomeDataResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetHomeDataResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetHomeDataErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetHomeDataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetLibraryDetailsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetLibraryDetailsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetLibraryDetailsErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetLibraryDetailsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetLibraryDetailsErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetLibraryDetailsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetLibraryDetailsErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetLibraryDetailsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetLibraryDetailsErrors withStatus(Optional<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;
}
GetLibraryDetailsErrors other = (GetLibraryDetailsErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetLibraryDetailsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetLibraryDetailsErrors build() {
return new GetLibraryDetailsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetLibraryDetailsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetLibraryDetailsResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetLibraryDetailsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetLibraryDetailsResponseBody(
@JsonProperty("errors") Optional<? extends List<GetLibraryDetailsErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetLibraryDetailsResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetLibraryDetailsErrors>> errors(){
return (Optional<List<GetLibraryDetailsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetLibraryDetailsResponseBody withErrors(List<GetLibraryDetailsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetLibraryDetailsResponseBody withErrors(Optional<? extends List<GetLibraryDetailsErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetLibraryDetailsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetLibraryDetailsResponseBody 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;
}
GetLibraryDetailsResponseBody other = (GetLibraryDetailsResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetLibraryDetailsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetLibraryDetailsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetLibraryDetailsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetLibraryDetailsErrors>> 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 GetLibraryDetailsResponseBody build() {
return new GetLibraryDetailsResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetLibraryHubsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetLibraryHubsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetLibraryHubsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetLibraryHubsErrors build() {
return new GetLibraryHubsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetLibraryHubsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetLibraryHubsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetLibraryHubsErrors>> errors(){
return (Optional<List<GetLibraryHubsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetLibraryHubsResponseBody withErrors(List<GetLibraryHubsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetLibraryHubsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetLibraryHubsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetLibraryHubsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetLibraryHubsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetLibraryItemsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetLibraryItemsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetLibraryItemsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetLibraryItemsErrors build() {
return new GetLibraryItemsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetLibraryItemsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetLibraryItemsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetLibraryItemsErrors>> errors(){
return (Optional<List<GetLibraryItemsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetLibraryItemsResponseBody withErrors(List<GetLibraryItemsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetLibraryItemsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetLibraryItemsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetLibraryItemsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetLibraryItemsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetMediaProvidersErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetMediaProvidersErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetMediaProvidersErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetMediaProvidersErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetMediaProvidersErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetMediaProvidersErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetMediaProvidersErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetMediaProvidersErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetMediaProvidersErrors withStatus(Optional<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;
}
GetMediaProvidersErrors other = (GetMediaProvidersErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetMediaProvidersErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetMediaProvidersErrors build() {
return new GetMediaProvidersErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetMediaProvidersResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetMediaProvidersResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetMediaProvidersErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetMediaProvidersResponseBody(
@JsonProperty("errors") Optional<? extends List<GetMediaProvidersErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetMediaProvidersResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetMediaProvidersErrors>> errors(){
return (Optional<List<GetMediaProvidersErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetMediaProvidersResponseBody withErrors(List<GetMediaProvidersErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetMediaProvidersResponseBody withErrors(Optional<? extends List<GetMediaProvidersErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetMediaProvidersResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetMediaProvidersResponseBody 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;
}
GetMediaProvidersResponseBody other = (GetMediaProvidersResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetMediaProvidersResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetMediaProvidersErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetMediaProvidersErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetMediaProvidersErrors>> 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 GetMediaProvidersResponseBody build() {
return new GetMediaProvidersResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetMetaDataByRatingKeyErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetMetaDataByRatingKeyErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetMetaDataByRatingKeyErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetMetaDataByRatingKeyErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetMetaDataByRatingKeyErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetMetaDataByRatingKeyErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetMetaDataByRatingKeyErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetMetaDataByRatingKeyErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetMetaDataByRatingKeyErrors withStatus(Optional<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;
}
GetMetaDataByRatingKeyErrors other = (GetMetaDataByRatingKeyErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetMetaDataByRatingKeyErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetMetaDataByRatingKeyErrors build() {
return new GetMetaDataByRatingKeyErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetMetaDataByRatingKeyResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetMetaDataByRatingKeyResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetMetaDataByRatingKeyErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetMetaDataByRatingKeyResponseBody(
@JsonProperty("errors") Optional<? extends List<GetMetaDataByRatingKeyErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetMetaDataByRatingKeyResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetMetaDataByRatingKeyErrors>> errors(){
return (Optional<List<GetMetaDataByRatingKeyErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetMetaDataByRatingKeyResponseBody withErrors(List<GetMetaDataByRatingKeyErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetMetaDataByRatingKeyResponseBody withErrors(Optional<? extends List<GetMetaDataByRatingKeyErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetMetaDataByRatingKeyResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetMetaDataByRatingKeyResponseBody 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;
}
GetMetaDataByRatingKeyResponseBody other = (GetMetaDataByRatingKeyResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetMetaDataByRatingKeyResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetMetaDataByRatingKeyErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetMetaDataByRatingKeyErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetMetaDataByRatingKeyErrors>> 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 GetMetaDataByRatingKeyResponseBody build() {
return new GetMetaDataByRatingKeyResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetMetadataChildrenErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetMetadataChildrenErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetMetadataChildrenErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetMetadataChildrenErrors build() {
return new GetMetadataChildrenErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetMetadataChildrenErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetMetadataChildrenResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetMetadataChildrenErrors>> errors(){
return (Optional<List<GetMetadataChildrenErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetMetadataChildrenResponseBody withErrors(List<GetMetadataChildrenErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetMetadataChildrenResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetMetadataChildrenResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetMetadataChildrenErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetMetadataChildrenErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetMyPlexAccountErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetMyPlexAccountErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetMyPlexAccountErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetMyPlexAccountErrors build() {
return new GetMyPlexAccountErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetMyPlexAccountErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetMyPlexAccountResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetMyPlexAccountErrors>> errors(){
return (Optional<List<GetMyPlexAccountErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetMyPlexAccountResponseBody withErrors(List<GetMyPlexAccountErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetMyPlexAccountResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetMyPlexAccountResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetMyPlexAccountErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetMyPlexAccountErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetOnDeckErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetOnDeckErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetOnDeckErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetOnDeckErrors build() {
return new GetOnDeckErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetOnDeckErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetOnDeckResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetOnDeckErrors>> errors(){
return (Optional<List<GetOnDeckErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetOnDeckResponseBody withErrors(List<GetOnDeckErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetOnDeckResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetOnDeckResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetOnDeckErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetOnDeckErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetPinErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Long> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Long> status;
@JsonCreator
public GetPinErrors(
@JsonProperty("code") Optional<Long> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Long> 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());
}
@JsonIgnore
public Optional<Long> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Long> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetPinErrors withCode(long code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetPinErrors withCode(Optional<Long> 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<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetPinErrors withStatus(long status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetPinErrors withStatus(Optional<Long> 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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetPinErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Long> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<Long> status = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder code(long code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public Builder code(Optional<Long> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public Builder message(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public Builder message(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public Builder status(long status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public Builder status(Optional<Long> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetPinErrors build() {
return new GetPinErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetPinResponseBody - Bad Request response when the X-Plex-Client-Identifier is missing
*/
public class GetPinResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetPinErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetPinResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetPinErrors>> errors(){
return (Optional<List<GetPinErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetPinResponseBody withErrors(List<GetPinErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetPinResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetPinResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetPinErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetPinErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetPlaylistContentsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetPlaylistContentsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetPlaylistContentsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetPlaylistContentsErrors build() {
return new GetPlaylistContentsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetPlaylistContentsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetPlaylistContentsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetPlaylistContentsErrors>> errors(){
return (Optional<List<GetPlaylistContentsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetPlaylistContentsResponseBody withErrors(List<GetPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetPlaylistContentsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetPlaylistContentsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetPlaylistContentsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetPlaylistErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetPlaylistErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetPlaylistErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetPlaylistErrors build() {
return new GetPlaylistErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetPlaylistErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetPlaylistResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetPlaylistErrors>> errors(){
return (Optional<List<GetPlaylistErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetPlaylistResponseBody withErrors(List<GetPlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetPlaylistResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetPlaylistResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetPlaylistErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetPlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetPlaylistsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetPlaylistsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetPlaylistsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetPlaylistsErrors build() {
return new GetPlaylistsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetPlaylistsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetPlaylistsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetPlaylistsErrors>> errors(){
return (Optional<List<GetPlaylistsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetPlaylistsResponseBody withErrors(List<GetPlaylistsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetPlaylistsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetPlaylistsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetPlaylistsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetPlaylistsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetRecentlyAddedErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetRecentlyAddedErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetRecentlyAddedErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetRecentlyAddedErrors build() {
return new GetRecentlyAddedErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetRecentlyAddedErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetRecentlyAddedResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetRecentlyAddedErrors>> errors(){
return (Optional<List<GetRecentlyAddedErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetRecentlyAddedResponseBody withErrors(List<GetRecentlyAddedErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetRecentlyAddedResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetRecentlyAddedResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetRecentlyAddedErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetRecentlyAddedErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetRefreshLibraryMetadataErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetRefreshLibraryMetadataErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetRefreshLibraryMetadataErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetRefreshLibraryMetadataErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetRefreshLibraryMetadataErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetRefreshLibraryMetadataErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetRefreshLibraryMetadataErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetRefreshLibraryMetadataErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetRefreshLibraryMetadataErrors withStatus(Optional<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;
}
GetRefreshLibraryMetadataErrors other = (GetRefreshLibraryMetadataErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetRefreshLibraryMetadataErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetRefreshLibraryMetadataErrors build() {
return new GetRefreshLibraryMetadataErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetRefreshLibraryMetadataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetRefreshLibraryMetadataResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetRefreshLibraryMetadataErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetRefreshLibraryMetadataResponseBody(
@JsonProperty("errors") Optional<? extends List<GetRefreshLibraryMetadataErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetRefreshLibraryMetadataResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetRefreshLibraryMetadataErrors>> errors(){
return (Optional<List<GetRefreshLibraryMetadataErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetRefreshLibraryMetadataResponseBody withErrors(List<GetRefreshLibraryMetadataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetRefreshLibraryMetadataResponseBody withErrors(Optional<? extends List<GetRefreshLibraryMetadataErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetRefreshLibraryMetadataResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetRefreshLibraryMetadataResponseBody 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;
}
GetRefreshLibraryMetadataResponseBody other = (GetRefreshLibraryMetadataResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetRefreshLibraryMetadataResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetRefreshLibraryMetadataErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetRefreshLibraryMetadataErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetRefreshLibraryMetadataErrors>> 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 GetRefreshLibraryMetadataResponseBody build() {
return new GetRefreshLibraryMetadataResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetResizedPhotoErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetResizedPhotoErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetResizedPhotoErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetResizedPhotoErrors build() {
return new GetResizedPhotoErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetResizedPhotoErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetResizedPhotoResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetResizedPhotoErrors>> errors(){
return (Optional<List<GetResizedPhotoErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetResizedPhotoResponseBody withErrors(List<GetResizedPhotoErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetResizedPhotoResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetResizedPhotoResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetResizedPhotoErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetResizedPhotoErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetResourcesStatisticsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetResourcesStatisticsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetResourcesStatisticsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetResourcesStatisticsErrors build() {
return new GetResourcesStatisticsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetResourcesStatisticsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetResourcesStatisticsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetResourcesStatisticsErrors>> errors(){
return (Optional<List<GetResourcesStatisticsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetResourcesStatisticsResponseBody withErrors(List<GetResourcesStatisticsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetResourcesStatisticsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetResourcesStatisticsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetResourcesStatisticsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetResourcesStatisticsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetSearchLibraryErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetSearchLibraryErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Double> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetSearchLibraryErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetSearchLibraryErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetSearchLibraryErrors withCode(Optional<Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetSearchLibraryErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetSearchLibraryErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetSearchLibraryErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetSearchLibraryErrors withStatus(Optional<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;
}
GetSearchLibraryErrors other = (GetSearchLibraryErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetSearchLibraryErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetSearchLibraryErrors build() {
return new GetSearchLibraryErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetSearchLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
public class GetSearchLibraryResponseBody extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetSearchLibraryErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetSearchLibraryResponseBody(
@JsonProperty("errors") Optional<? extends List<GetSearchLibraryErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetSearchLibraryResponseBody() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetSearchLibraryErrors>> errors(){
return (Optional<List<GetSearchLibraryErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetSearchLibraryResponseBody withErrors(List<GetSearchLibraryErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetSearchLibraryResponseBody withErrors(Optional<? extends List<GetSearchLibraryErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetSearchLibraryResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetSearchLibraryResponseBody 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;
}
GetSearchLibraryResponseBody other = (GetSearchLibraryResponseBody) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetSearchLibraryResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetSearchLibraryErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetSearchLibraryErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetSearchLibraryErrors>> 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 GetSearchLibraryResponseBody build() {
return new GetSearchLibraryResponseBody(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetSearchResultsErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetSearchResultsErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetSearchResultsErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetSearchResultsErrors build() {
return new GetSearchResultsErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetSearchResultsErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetSearchResultsResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetSearchResultsErrors>> errors(){
return (Optional<List<GetSearchResultsErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetSearchResultsResponseBody withErrors(List<GetSearchResultsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetSearchResultsResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetSearchResultsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetSearchResultsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetSearchResultsErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetServerActivitiesErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Double> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Double> status;
@JsonCreator
public GetServerActivitiesErrors(
@JsonProperty("code") Optional<Double> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<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());
}
@JsonIgnore
public Optional<Double> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Double> status() {
return 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<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<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<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
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetServerActivitiesErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Double> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<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<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<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<Double> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetServerActivitiesErrors build() {
return new GetServerActivitiesErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 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 List<GetServerActivitiesErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetServerActivitiesResponseBody(
@JsonProperty("errors") Optional<? extends 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());
}
@SuppressWarnings("unchecked")
public Optional<List<GetServerActivitiesErrors>> errors(){
return (Optional<List<GetServerActivitiesErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetServerActivitiesResponseBody withErrors(List<GetServerActivitiesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetServerActivitiesResponseBody withErrors(Optional<? extends 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
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetServerActivitiesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetServerActivitiesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetServerActivitiesErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends 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);
}
}
}

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