ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.535.1

This commit is contained in:
speakeasybot
2025-04-19 00:29:11 +00:00
parent 4b28ca3416
commit 0077561a6a
74 changed files with 8280 additions and 931 deletions

View File

@@ -700,14 +700,14 @@ public class Library implements
*
* <p>## Library Details Endpoint
*
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
*
* <p>The details include:
*
* <p>### Directories
* Organized into three categories:
*
* <p>- **Primary Directories**:
* <p>- **Primary Directories**:
* - Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
* - Most can be replicated via media queries.
* - Customizable by users.
@@ -749,14 +749,14 @@ public class Library implements
*
* <p>## Library Details Endpoint
*
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
*
* <p>The details include:
*
* <p>### Directories
* Organized into three categories:
*
* <p>- **Primary Directories**:
* <p>- **Primary Directories**:
* - Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
* - Most can be replicated via media queries.
* - Customizable by users.
@@ -803,14 +803,14 @@ public class Library implements
*
* <p>## Library Details Endpoint
*
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
*
* <p>The details include:
*
* <p>### Directories
* Organized into three categories:
*
* <p>- **Primary Directories**:
* <p>- **Primary Directories**:
* - Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
* - Most can be replicated via media queries.
* - Customizable by users.
@@ -841,7 +841,7 @@ public class Library implements
*
* <p>&gt; **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
*
* @param includeDetails Whether or not to include details for a section (types, filters, and sorts).
* @param includeDetails Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*
* @param sectionKey The unique key of the Plex library.

View File

@@ -68,11 +68,11 @@ public class Log implements
*
* <p>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
* @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.
@@ -232,13 +232,13 @@ public class Log implements
/**
* Logging a multi-line message
*
* <p>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'.
* <p>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'.
*
* <p>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.
* <p>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.
*
* <p>The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.
@@ -263,13 +263,13 @@ public class Log implements
/**
* Logging a multi-line message
*
* <p>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'.
* <p>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'.
*
* <p>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.
* <p>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.
*
* <p>The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.

View File

@@ -76,9 +76,9 @@ import java.util.List;
import java.util.Optional;
/**
* 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").
* 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.
* 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 class Playlists implements
@@ -1562,16 +1562,16 @@ public class Playlists implements
*
* <p>Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
*
* @param path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* @param path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
*
* @param force Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* @param force Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
*
* @param sectionID Possibly the section ID to upload the playlist to, we are not certain.

View File

@@ -52,7 +52,7 @@ public class PlexAPI {
/**
* The full address of your Plex Server
*/
"{protocol}://{ip}:{port}",
"https://10.10.10.47:32400",
};
/**
@@ -117,9 +117,9 @@ public class PlexAPI {
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").
* 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.
* 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;
@@ -231,9 +231,9 @@ public class PlexAPI {
}
/**
* 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").
* 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.
* 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() {

View File

@@ -42,8 +42,8 @@ class SDKConfiguration {
} };
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.0.3";
public static final String SDK_VERSION = "0.15.0";
public static final String GEN_VERSION = "2.570.4";
public static final String SDK_VERSION = "0.16.0";
public static final String GEN_VERSION = "2.585.2";
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* CreatePlaylistQueryParamType
*
* <p>type of playlist to create
*/
public enum CreatePlaylistQueryParamType {
AUDIO("audio"),
VIDEO("video"),
PHOTO("photo");
@JsonDeserialize(using = CreatePlaylistQueryParamType._Deserializer.class)
@JsonSerialize(using = CreatePlaylistQueryParamType._Serializer.class)
public class CreatePlaylistQueryParamType {
public static final CreatePlaylistQueryParamType AUDIO = new CreatePlaylistQueryParamType("audio");
public static final CreatePlaylistQueryParamType VIDEO = new CreatePlaylistQueryParamType("video");
public static final CreatePlaylistQueryParamType PHOTO = new CreatePlaylistQueryParamType("photo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, CreatePlaylistQueryParamType> values = createValuesMap();
private static final Map<String, CreatePlaylistQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private CreatePlaylistQueryParamType(String value) {
this.value = value;
}
/**
* Returns a CreatePlaylistQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as CreatePlaylistQueryParamType
*/
public static CreatePlaylistQueryParamType of(String value) {
synchronized (CreatePlaylistQueryParamType.class) {
return values.computeIfAbsent(value, v -> new CreatePlaylistQueryParamType(v));
}
}
public String value() {
return value;
}
public static Optional<CreatePlaylistQueryParamType> fromValue(String value) {
for (CreatePlaylistQueryParamType o: CreatePlaylistQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<CreatePlaylistQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CreatePlaylistQueryParamType other = (CreatePlaylistQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "CreatePlaylistQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static CreatePlaylistQueryParamType[] values() {
synchronized (CreatePlaylistQueryParamType.class) {
return values.values().toArray(new CreatePlaylistQueryParamType[] {});
}
}
private static final Map<String, CreatePlaylistQueryParamType> createValuesMap() {
Map<String, CreatePlaylistQueryParamType> map = new LinkedHashMap<>();
map.put("audio", AUDIO);
map.put("video", VIDEO);
map.put("photo", PHOTO);
return map;
}
private static final Map<String, CreatePlaylistQueryParamTypeEnum> createEnumsMap() {
Map<String, CreatePlaylistQueryParamTypeEnum> map = new HashMap<>();
map.put("audio", CreatePlaylistQueryParamTypeEnum.AUDIO);
map.put("video", CreatePlaylistQueryParamTypeEnum.VIDEO);
map.put("photo", CreatePlaylistQueryParamTypeEnum.PHOTO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<CreatePlaylistQueryParamType> {
protected _Serializer() {
super(CreatePlaylistQueryParamType.class);
}
@Override
public void serialize(CreatePlaylistQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<CreatePlaylistQueryParamType> {
protected _Deserializer() {
super(CreatePlaylistQueryParamType.class);
}
@Override
public CreatePlaylistQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return CreatePlaylistQueryParamType.of(v);
}
}
public enum CreatePlaylistQueryParamTypeEnum {
AUDIO("audio"),
VIDEO("video"),
PHOTO("photo"),;
private final String value;
private CreatePlaylistQueryParamTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* EnableCreditsMarkerGeneration
*
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public enum EnableCreditsMarkerGeneration {
LibraryDefault("-1"),
Disabled("0");
@JsonDeserialize(using = EnableCreditsMarkerGeneration._Deserializer.class)
@JsonSerialize(using = EnableCreditsMarkerGeneration._Serializer.class)
public class EnableCreditsMarkerGeneration {
public static final EnableCreditsMarkerGeneration LibraryDefault = new EnableCreditsMarkerGeneration("-1");
public static final EnableCreditsMarkerGeneration Disabled = new EnableCreditsMarkerGeneration("0");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, EnableCreditsMarkerGeneration> values = createValuesMap();
private static final Map<String, EnableCreditsMarkerGenerationEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private EnableCreditsMarkerGeneration(String value) {
this.value = value;
}
/**
* Returns a EnableCreditsMarkerGeneration with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as EnableCreditsMarkerGeneration
*/
public static EnableCreditsMarkerGeneration of(String value) {
synchronized (EnableCreditsMarkerGeneration.class) {
return values.computeIfAbsent(value, v -> new EnableCreditsMarkerGeneration(v));
}
}
public String value() {
return value;
}
public static Optional<EnableCreditsMarkerGeneration> fromValue(String value) {
for (EnableCreditsMarkerGeneration o: EnableCreditsMarkerGeneration.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<EnableCreditsMarkerGenerationEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EnableCreditsMarkerGeneration other = (EnableCreditsMarkerGeneration) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "EnableCreditsMarkerGeneration [value=" + value + "]";
}
// return an array just like an enum
public static EnableCreditsMarkerGeneration[] values() {
synchronized (EnableCreditsMarkerGeneration.class) {
return values.values().toArray(new EnableCreditsMarkerGeneration[] {});
}
}
private static final Map<String, EnableCreditsMarkerGeneration> createValuesMap() {
Map<String, EnableCreditsMarkerGeneration> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Disabled);
return map;
}
private static final Map<String, EnableCreditsMarkerGenerationEnum> createEnumsMap() {
Map<String, EnableCreditsMarkerGenerationEnum> map = new HashMap<>();
map.put("-1", EnableCreditsMarkerGenerationEnum.LibraryDefault);
map.put("0", EnableCreditsMarkerGenerationEnum.Disabled);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<EnableCreditsMarkerGeneration> {
protected _Serializer() {
super(EnableCreditsMarkerGeneration.class);
}
@Override
public void serialize(EnableCreditsMarkerGeneration value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<EnableCreditsMarkerGeneration> {
protected _Deserializer() {
super(EnableCreditsMarkerGeneration.class);
}
@Override
public EnableCreditsMarkerGeneration deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return EnableCreditsMarkerGeneration.of(v);
}
}
public enum EnableCreditsMarkerGenerationEnum {
LibraryDefault("-1"),
Disabled("0"),;
private final String value;
private EnableCreditsMarkerGenerationEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* EpisodeSort
*
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public enum EpisodeSort {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1");
@JsonDeserialize(using = EpisodeSort._Deserializer.class)
@JsonSerialize(using = EpisodeSort._Serializer.class)
public class EpisodeSort {
public static final EpisodeSort LibraryDefault = new EpisodeSort("-1");
public static final EpisodeSort OldestFirst = new EpisodeSort("0");
public static final EpisodeSort NewestFirst = new EpisodeSort("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, EpisodeSort> values = createValuesMap();
private static final Map<String, EpisodeSortEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private EpisodeSort(String value) {
this.value = value;
}
/**
* Returns a EpisodeSort with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as EpisodeSort
*/
public static EpisodeSort of(String value) {
synchronized (EpisodeSort.class) {
return values.computeIfAbsent(value, v -> new EpisodeSort(v));
}
}
public String value() {
return value;
}
public static Optional<EpisodeSort> fromValue(String value) {
for (EpisodeSort o: EpisodeSort.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<EpisodeSortEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EpisodeSort other = (EpisodeSort) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "EpisodeSort [value=" + value + "]";
}
// return an array just like an enum
public static EpisodeSort[] values() {
synchronized (EpisodeSort.class) {
return values.values().toArray(new EpisodeSort[] {});
}
}
private static final Map<String, EpisodeSort> createValuesMap() {
Map<String, EpisodeSort> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", OldestFirst);
map.put("1", NewestFirst);
return map;
}
private static final Map<String, EpisodeSortEnum> createEnumsMap() {
Map<String, EpisodeSortEnum> map = new HashMap<>();
map.put("-1", EpisodeSortEnum.LibraryDefault);
map.put("0", EpisodeSortEnum.OldestFirst);
map.put("1", EpisodeSortEnum.NewestFirst);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<EpisodeSort> {
protected _Serializer() {
super(EpisodeSort.class);
}
@Override
public void serialize(EpisodeSort value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<EpisodeSort> {
protected _Deserializer() {
super(EpisodeSort.class);
}
@Override
public EpisodeSort deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return EpisodeSort.of(v);
}
}
public enum EpisodeSortEnum {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1"),;
private final String value;
private EpisodeSortEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Filter
*
* <p>Filter
*/
public enum Filter {
ALL("all"),
AVAILABLE("available"),
RELEASED("released");
@JsonDeserialize(using = Filter._Deserializer.class)
@JsonSerialize(using = Filter._Serializer.class)
public class Filter {
public static final Filter ALL = new Filter("all");
public static final Filter AVAILABLE = new Filter("available");
public static final Filter RELEASED = new Filter("released");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, Filter> values = createValuesMap();
private static final Map<String, FilterEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private Filter(String value) {
this.value = value;
}
/**
* Returns a Filter with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Filter
*/
public static Filter of(String value) {
synchronized (Filter.class) {
return values.computeIfAbsent(value, v -> new Filter(v));
}
}
public String value() {
return value;
}
public static Optional<Filter> fromValue(String value) {
for (Filter o: Filter.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<FilterEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Filter other = (Filter) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Filter [value=" + value + "]";
}
// return an array just like an enum
public static Filter[] values() {
synchronized (Filter.class) {
return values.values().toArray(new Filter[] {});
}
}
private static final Map<String, Filter> createValuesMap() {
Map<String, Filter> map = new LinkedHashMap<>();
map.put("all", ALL);
map.put("available", AVAILABLE);
map.put("released", RELEASED);
return map;
}
private static final Map<String, FilterEnum> createEnumsMap() {
Map<String, FilterEnum> map = new HashMap<>();
map.put("all", FilterEnum.ALL);
map.put("available", FilterEnum.AVAILABLE);
map.put("released", FilterEnum.RELEASED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Filter> {
protected _Serializer() {
super(Filter.class);
}
@Override
public void serialize(Filter value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Filter> {
protected _Deserializer() {
super(Filter.class);
}
@Override
public Filter deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return Filter.of(v);
}
}
public enum FilterEnum {
ALL("all"),
AVAILABLE("available"),
RELEASED("released"),;
private final String value;
private FilterEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* FlattenSeasons
*
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public enum FlattenSeasons {
LibraryDefault("-1"),
Hide("0"),
Show("1");
@JsonDeserialize(using = FlattenSeasons._Deserializer.class)
@JsonSerialize(using = FlattenSeasons._Serializer.class)
public class FlattenSeasons {
public static final FlattenSeasons LibraryDefault = new FlattenSeasons("-1");
public static final FlattenSeasons Hide = new FlattenSeasons("0");
public static final FlattenSeasons Show = new FlattenSeasons("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, FlattenSeasons> values = createValuesMap();
private static final Map<String, FlattenSeasonsEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private FlattenSeasons(String value) {
this.value = value;
}
/**
* Returns a FlattenSeasons with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as FlattenSeasons
*/
public static FlattenSeasons of(String value) {
synchronized (FlattenSeasons.class) {
return values.computeIfAbsent(value, v -> new FlattenSeasons(v));
}
}
public String value() {
return value;
}
public static Optional<FlattenSeasons> fromValue(String value) {
for (FlattenSeasons o: FlattenSeasons.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<FlattenSeasonsEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FlattenSeasons other = (FlattenSeasons) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "FlattenSeasons [value=" + value + "]";
}
// return an array just like an enum
public static FlattenSeasons[] values() {
synchronized (FlattenSeasons.class) {
return values.values().toArray(new FlattenSeasons[] {});
}
}
private static final Map<String, FlattenSeasons> createValuesMap() {
Map<String, FlattenSeasons> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Hide);
map.put("1", Show);
return map;
}
private static final Map<String, FlattenSeasonsEnum> createEnumsMap() {
Map<String, FlattenSeasonsEnum> map = new HashMap<>();
map.put("-1", FlattenSeasonsEnum.LibraryDefault);
map.put("0", FlattenSeasonsEnum.Hide);
map.put("1", FlattenSeasonsEnum.Show);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<FlattenSeasons> {
protected _Serializer() {
super(FlattenSeasons.class);
}
@Override
public void serialize(FlattenSeasons value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<FlattenSeasons> {
protected _Deserializer() {
super(FlattenSeasons.class);
}
@Override
public FlattenSeasons deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return FlattenSeasons.of(v);
}
}
public enum FlattenSeasonsEnum {
LibraryDefault("-1"),
Hide("0"),
Show("1"),;
private final String value;
private FlattenSeasonsEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetActorsLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetActorsLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetActorsLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetActorsLibraryQueryParamType._Serializer.class)
public class GetActorsLibraryQueryParamType {
public static final GetActorsLibraryQueryParamType Movie = new GetActorsLibraryQueryParamType(1L);
public static final GetActorsLibraryQueryParamType TvShow = new GetActorsLibraryQueryParamType(2L);
public static final GetActorsLibraryQueryParamType Season = new GetActorsLibraryQueryParamType(3L);
public static final GetActorsLibraryQueryParamType Episode = new GetActorsLibraryQueryParamType(4L);
public static final GetActorsLibraryQueryParamType Audio = new GetActorsLibraryQueryParamType(8L);
public static final GetActorsLibraryQueryParamType Album = new GetActorsLibraryQueryParamType(9L);
public static final GetActorsLibraryQueryParamType Track = new GetActorsLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetActorsLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetActorsLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetActorsLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetActorsLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetActorsLibraryQueryParamType
*/
public static GetActorsLibraryQueryParamType of(long value) {
synchronized (GetActorsLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetActorsLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetActorsLibraryQueryParamType> fromValue(long value) {
for (GetActorsLibraryQueryParamType o: GetActorsLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetActorsLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetActorsLibraryQueryParamType other = (GetActorsLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetActorsLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetActorsLibraryQueryParamType[] values() {
synchronized (GetActorsLibraryQueryParamType.class) {
return values.values().toArray(new GetActorsLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetActorsLibraryQueryParamType> createValuesMap() {
Map<Long, GetActorsLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetActorsLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetActorsLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetActorsLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetActorsLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetActorsLibraryQueryParamTypeEnum.Season);
map.put(4L, GetActorsLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetActorsLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetActorsLibraryQueryParamTypeEnum.Album);
map.put(10L, GetActorsLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetActorsLibraryQueryParamType> {
protected _Serializer() {
super(GetActorsLibraryQueryParamType.class);
}
@Override
public void serialize(GetActorsLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetActorsLibraryQueryParamType> {
protected _Deserializer() {
super(GetActorsLibraryQueryParamType.class);
}
@Override
public GetActorsLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetActorsLibraryQueryParamType.of(v);
}
}
public enum GetActorsLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetActorsLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetAllLibrariesType
*
* <p>The library type
*/
public enum GetAllLibrariesType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetAllLibrariesType._Deserializer.class)
@JsonSerialize(using = GetAllLibrariesType._Serializer.class)
public class GetAllLibrariesType {
public static final GetAllLibrariesType Movie = new GetAllLibrariesType("movie");
public static final GetAllLibrariesType TvShow = new GetAllLibrariesType("show");
public static final GetAllLibrariesType Season = new GetAllLibrariesType("season");
public static final GetAllLibrariesType Episode = new GetAllLibrariesType("episode");
public static final GetAllLibrariesType Artist = new GetAllLibrariesType("artist");
public static final GetAllLibrariesType Album = new GetAllLibrariesType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetAllLibrariesType> values = createValuesMap();
private static final Map<String, GetAllLibrariesTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetAllLibrariesType(String value) {
this.value = value;
}
/**
* Returns a GetAllLibrariesType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllLibrariesType
*/
public static GetAllLibrariesType of(String value) {
synchronized (GetAllLibrariesType.class) {
return values.computeIfAbsent(value, v -> new GetAllLibrariesType(v));
}
}
public String value() {
return value;
}
public static Optional<GetAllLibrariesType> fromValue(String value) {
for (GetAllLibrariesType o: GetAllLibrariesType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllLibrariesTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllLibrariesType other = (GetAllLibrariesType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllLibrariesType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllLibrariesType[] values() {
synchronized (GetAllLibrariesType.class) {
return values.values().toArray(new GetAllLibrariesType[] {});
}
}
private static final Map<String, GetAllLibrariesType> createValuesMap() {
Map<String, GetAllLibrariesType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetAllLibrariesTypeEnum> createEnumsMap() {
Map<String, GetAllLibrariesTypeEnum> map = new HashMap<>();
map.put("movie", GetAllLibrariesTypeEnum.Movie);
map.put("show", GetAllLibrariesTypeEnum.TvShow);
map.put("season", GetAllLibrariesTypeEnum.Season);
map.put("episode", GetAllLibrariesTypeEnum.Episode);
map.put("artist", GetAllLibrariesTypeEnum.Artist);
map.put("album", GetAllLibrariesTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllLibrariesType> {
protected _Serializer() {
super(GetAllLibrariesType.class);
}
@Override
public void serialize(GetAllLibrariesType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllLibrariesType> {
protected _Deserializer() {
super(GetAllLibrariesType.class);
}
@Override
public GetAllLibrariesType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetAllLibrariesType.of(v);
}
}
public enum GetAllLibrariesTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetAllLibrariesTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetAllMediaLibraryLibraryResponseType {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetAllMediaLibraryLibraryResponseType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryLibraryResponseType._Serializer.class)
public class GetAllMediaLibraryLibraryResponseType {
public static final GetAllMediaLibraryLibraryResponseType COVER_POSTER = new GetAllMediaLibraryLibraryResponseType("coverPoster");
public static final GetAllMediaLibraryLibraryResponseType BACKGROUND = new GetAllMediaLibraryLibraryResponseType("background");
public static final GetAllMediaLibraryLibraryResponseType SNAPSHOT = new GetAllMediaLibraryLibraryResponseType("snapshot");
public static final GetAllMediaLibraryLibraryResponseType CLEAR_LOGO = new GetAllMediaLibraryLibraryResponseType("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetAllMediaLibraryLibraryResponseType> values = createValuesMap();
private static final Map<String, GetAllMediaLibraryLibraryResponseTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetAllMediaLibraryLibraryResponseType(String value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryLibraryResponseType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllMediaLibraryLibraryResponseType
*/
public static GetAllMediaLibraryLibraryResponseType of(String value) {
synchronized (GetAllMediaLibraryLibraryResponseType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryLibraryResponseType(v));
}
}
public String value() {
return value;
}
public static Optional<GetAllMediaLibraryLibraryResponseType> fromValue(String value) {
for (GetAllMediaLibraryLibraryResponseType o: GetAllMediaLibraryLibraryResponseType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllMediaLibraryLibraryResponseTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllMediaLibraryLibraryResponseType other = (GetAllMediaLibraryLibraryResponseType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryLibraryResponseType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryLibraryResponseType[] values() {
synchronized (GetAllMediaLibraryLibraryResponseType.class) {
return values.values().toArray(new GetAllMediaLibraryLibraryResponseType[] {});
}
}
private static final Map<String, GetAllMediaLibraryLibraryResponseType> createValuesMap() {
Map<String, GetAllMediaLibraryLibraryResponseType> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetAllMediaLibraryLibraryResponseTypeEnum> createEnumsMap() {
Map<String, GetAllMediaLibraryLibraryResponseTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetAllMediaLibraryLibraryResponseTypeEnum.COVER_POSTER);
map.put("background", GetAllMediaLibraryLibraryResponseTypeEnum.BACKGROUND);
map.put("snapshot", GetAllMediaLibraryLibraryResponseTypeEnum.SNAPSHOT);
map.put("clearLogo", GetAllMediaLibraryLibraryResponseTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryLibraryResponseType> {
protected _Serializer() {
super(GetAllMediaLibraryLibraryResponseType.class);
}
@Override
public void serialize(GetAllMediaLibraryLibraryResponseType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryLibraryResponseType> {
protected _Deserializer() {
super(GetAllMediaLibraryLibraryResponseType.class);
}
@Override
public GetAllMediaLibraryLibraryResponseType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryLibraryResponseType.of(v);
}
}
public enum GetAllMediaLibraryLibraryResponseTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetAllMediaLibraryLibraryResponseTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetAllMediaLibraryLibraryType
*
* <p>The type of media content
*/
public enum GetAllMediaLibraryLibraryType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetAllMediaLibraryLibraryType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryLibraryType._Serializer.class)
public class GetAllMediaLibraryLibraryType {
public static final GetAllMediaLibraryLibraryType Movie = new GetAllMediaLibraryLibraryType("movie");
public static final GetAllMediaLibraryLibraryType TvShow = new GetAllMediaLibraryLibraryType("show");
public static final GetAllMediaLibraryLibraryType Season = new GetAllMediaLibraryLibraryType("season");
public static final GetAllMediaLibraryLibraryType Episode = new GetAllMediaLibraryLibraryType("episode");
public static final GetAllMediaLibraryLibraryType Artist = new GetAllMediaLibraryLibraryType("artist");
public static final GetAllMediaLibraryLibraryType Album = new GetAllMediaLibraryLibraryType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetAllMediaLibraryLibraryType> values = createValuesMap();
private static final Map<String, GetAllMediaLibraryLibraryTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetAllMediaLibraryLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryLibraryType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllMediaLibraryLibraryType
*/
public static GetAllMediaLibraryLibraryType of(String value) {
synchronized (GetAllMediaLibraryLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryLibraryType(v));
}
}
public String value() {
return value;
}
public static Optional<GetAllMediaLibraryLibraryType> fromValue(String value) {
for (GetAllMediaLibraryLibraryType o: GetAllMediaLibraryLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllMediaLibraryLibraryTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllMediaLibraryLibraryType other = (GetAllMediaLibraryLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryLibraryType[] values() {
synchronized (GetAllMediaLibraryLibraryType.class) {
return values.values().toArray(new GetAllMediaLibraryLibraryType[] {});
}
}
private static final Map<String, GetAllMediaLibraryLibraryType> createValuesMap() {
Map<String, GetAllMediaLibraryLibraryType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetAllMediaLibraryLibraryTypeEnum> createEnumsMap() {
Map<String, GetAllMediaLibraryLibraryTypeEnum> map = new HashMap<>();
map.put("movie", GetAllMediaLibraryLibraryTypeEnum.Movie);
map.put("show", GetAllMediaLibraryLibraryTypeEnum.TvShow);
map.put("season", GetAllMediaLibraryLibraryTypeEnum.Season);
map.put("episode", GetAllMediaLibraryLibraryTypeEnum.Episode);
map.put("artist", GetAllMediaLibraryLibraryTypeEnum.Artist);
map.put("album", GetAllMediaLibraryLibraryTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryLibraryType> {
protected _Serializer() {
super(GetAllMediaLibraryLibraryType.class);
}
@Override
public void serialize(GetAllMediaLibraryLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryLibraryType> {
protected _Deserializer() {
super(GetAllMediaLibraryLibraryType.class);
}
@Override
public GetAllMediaLibraryLibraryType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryLibraryType.of(v);
}
}
public enum GetAllMediaLibraryLibraryTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetAllMediaLibraryLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetAllMediaLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetAllMediaLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetAllMediaLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryQueryParamType._Serializer.class)
public class GetAllMediaLibraryQueryParamType {
public static final GetAllMediaLibraryQueryParamType Movie = new GetAllMediaLibraryQueryParamType(1L);
public static final GetAllMediaLibraryQueryParamType TvShow = new GetAllMediaLibraryQueryParamType(2L);
public static final GetAllMediaLibraryQueryParamType Season = new GetAllMediaLibraryQueryParamType(3L);
public static final GetAllMediaLibraryQueryParamType Episode = new GetAllMediaLibraryQueryParamType(4L);
public static final GetAllMediaLibraryQueryParamType Audio = new GetAllMediaLibraryQueryParamType(8L);
public static final GetAllMediaLibraryQueryParamType Album = new GetAllMediaLibraryQueryParamType(9L);
public static final GetAllMediaLibraryQueryParamType Track = new GetAllMediaLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetAllMediaLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetAllMediaLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetAllMediaLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllMediaLibraryQueryParamType
*/
public static GetAllMediaLibraryQueryParamType of(long value) {
synchronized (GetAllMediaLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetAllMediaLibraryQueryParamType> fromValue(long value) {
for (GetAllMediaLibraryQueryParamType o: GetAllMediaLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllMediaLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllMediaLibraryQueryParamType other = (GetAllMediaLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryQueryParamType[] values() {
synchronized (GetAllMediaLibraryQueryParamType.class) {
return values.values().toArray(new GetAllMediaLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetAllMediaLibraryQueryParamType> createValuesMap() {
Map<Long, GetAllMediaLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetAllMediaLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetAllMediaLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetAllMediaLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetAllMediaLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetAllMediaLibraryQueryParamTypeEnum.Season);
map.put(4L, GetAllMediaLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetAllMediaLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetAllMediaLibraryQueryParamTypeEnum.Album);
map.put(10L, GetAllMediaLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryQueryParamType> {
protected _Serializer() {
super(GetAllMediaLibraryQueryParamType.class);
}
@Override
public void serialize(GetAllMediaLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryQueryParamType> {
protected _Deserializer() {
super(GetAllMediaLibraryQueryParamType.class);
}
@Override
public GetAllMediaLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryQueryParamType.of(v);
}
}
public enum GetAllMediaLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetAllMediaLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetCountriesLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetCountriesLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetCountriesLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetCountriesLibraryQueryParamType._Serializer.class)
public class GetCountriesLibraryQueryParamType {
public static final GetCountriesLibraryQueryParamType Movie = new GetCountriesLibraryQueryParamType(1L);
public static final GetCountriesLibraryQueryParamType TvShow = new GetCountriesLibraryQueryParamType(2L);
public static final GetCountriesLibraryQueryParamType Season = new GetCountriesLibraryQueryParamType(3L);
public static final GetCountriesLibraryQueryParamType Episode = new GetCountriesLibraryQueryParamType(4L);
public static final GetCountriesLibraryQueryParamType Audio = new GetCountriesLibraryQueryParamType(8L);
public static final GetCountriesLibraryQueryParamType Album = new GetCountriesLibraryQueryParamType(9L);
public static final GetCountriesLibraryQueryParamType Track = new GetCountriesLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetCountriesLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetCountriesLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetCountriesLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetCountriesLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetCountriesLibraryQueryParamType
*/
public static GetCountriesLibraryQueryParamType of(long value) {
synchronized (GetCountriesLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetCountriesLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetCountriesLibraryQueryParamType> fromValue(long value) {
for (GetCountriesLibraryQueryParamType o: GetCountriesLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetCountriesLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetCountriesLibraryQueryParamType other = (GetCountriesLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetCountriesLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetCountriesLibraryQueryParamType[] values() {
synchronized (GetCountriesLibraryQueryParamType.class) {
return values.values().toArray(new GetCountriesLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetCountriesLibraryQueryParamType> createValuesMap() {
Map<Long, GetCountriesLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetCountriesLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetCountriesLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetCountriesLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetCountriesLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetCountriesLibraryQueryParamTypeEnum.Season);
map.put(4L, GetCountriesLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetCountriesLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetCountriesLibraryQueryParamTypeEnum.Album);
map.put(10L, GetCountriesLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetCountriesLibraryQueryParamType> {
protected _Serializer() {
super(GetCountriesLibraryQueryParamType.class);
}
@Override
public void serialize(GetCountriesLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetCountriesLibraryQueryParamType> {
protected _Deserializer() {
super(GetCountriesLibraryQueryParamType.class);
}
@Override
public GetCountriesLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetCountriesLibraryQueryParamType.of(v);
}
}
public enum GetCountriesLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetCountriesLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetGenresLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetGenresLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetGenresLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetGenresLibraryQueryParamType._Serializer.class)
public class GetGenresLibraryQueryParamType {
public static final GetGenresLibraryQueryParamType Movie = new GetGenresLibraryQueryParamType(1L);
public static final GetGenresLibraryQueryParamType TvShow = new GetGenresLibraryQueryParamType(2L);
public static final GetGenresLibraryQueryParamType Season = new GetGenresLibraryQueryParamType(3L);
public static final GetGenresLibraryQueryParamType Episode = new GetGenresLibraryQueryParamType(4L);
public static final GetGenresLibraryQueryParamType Audio = new GetGenresLibraryQueryParamType(8L);
public static final GetGenresLibraryQueryParamType Album = new GetGenresLibraryQueryParamType(9L);
public static final GetGenresLibraryQueryParamType Track = new GetGenresLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetGenresLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetGenresLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetGenresLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetGenresLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetGenresLibraryQueryParamType
*/
public static GetGenresLibraryQueryParamType of(long value) {
synchronized (GetGenresLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetGenresLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetGenresLibraryQueryParamType> fromValue(long value) {
for (GetGenresLibraryQueryParamType o: GetGenresLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetGenresLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetGenresLibraryQueryParamType other = (GetGenresLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetGenresLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetGenresLibraryQueryParamType[] values() {
synchronized (GetGenresLibraryQueryParamType.class) {
return values.values().toArray(new GetGenresLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetGenresLibraryQueryParamType> createValuesMap() {
Map<Long, GetGenresLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetGenresLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetGenresLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetGenresLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetGenresLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetGenresLibraryQueryParamTypeEnum.Season);
map.put(4L, GetGenresLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetGenresLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetGenresLibraryQueryParamTypeEnum.Album);
map.put(10L, GetGenresLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetGenresLibraryQueryParamType> {
protected _Serializer() {
super(GetGenresLibraryQueryParamType.class);
}
@Override
public void serialize(GetGenresLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetGenresLibraryQueryParamType> {
protected _Deserializer() {
super(GetGenresLibraryQueryParamType.class);
}
@Override
public GetGenresLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetGenresLibraryQueryParamType.of(v);
}
}
public enum GetGenresLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetGenresLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -19,7 +19,7 @@ import java.util.Optional;
public class GetLibraryDetailsRequest {
/**
* Whether or not to include details for a section (types, filters, and sorts).
* Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails")
@@ -48,7 +48,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
@SuppressWarnings("unchecked")
@@ -71,7 +71,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
public GetLibraryDetailsRequest withIncludeDetails(IncludeDetails includeDetails) {
@@ -81,7 +81,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
public GetLibraryDetailsRequest withIncludeDetails(Optional<? extends IncludeDetails> includeDetails) {
@@ -140,7 +140,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
public Builder includeDetails(IncludeDetails includeDetails) {
@@ -150,7 +150,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
public Builder includeDetails(Optional<? extends IncludeDetails> includeDetails) {

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetLibraryItemsLibraryResponse200Type {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetLibraryItemsLibraryResponse200Type._Deserializer.class)
@JsonSerialize(using = GetLibraryItemsLibraryResponse200Type._Serializer.class)
public class GetLibraryItemsLibraryResponse200Type {
public static final GetLibraryItemsLibraryResponse200Type COVER_POSTER = new GetLibraryItemsLibraryResponse200Type("coverPoster");
public static final GetLibraryItemsLibraryResponse200Type BACKGROUND = new GetLibraryItemsLibraryResponse200Type("background");
public static final GetLibraryItemsLibraryResponse200Type SNAPSHOT = new GetLibraryItemsLibraryResponse200Type("snapshot");
public static final GetLibraryItemsLibraryResponse200Type CLEAR_LOGO = new GetLibraryItemsLibraryResponse200Type("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetLibraryItemsLibraryResponse200Type> values = createValuesMap();
private static final Map<String, GetLibraryItemsLibraryResponse200TypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetLibraryItemsLibraryResponse200Type(String value) {
this.value = value;
}
/**
* Returns a GetLibraryItemsLibraryResponse200Type with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetLibraryItemsLibraryResponse200Type
*/
public static GetLibraryItemsLibraryResponse200Type of(String value) {
synchronized (GetLibraryItemsLibraryResponse200Type.class) {
return values.computeIfAbsent(value, v -> new GetLibraryItemsLibraryResponse200Type(v));
}
}
public String value() {
return value;
}
public static Optional<GetLibraryItemsLibraryResponse200Type> fromValue(String value) {
for (GetLibraryItemsLibraryResponse200Type o: GetLibraryItemsLibraryResponse200Type.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetLibraryItemsLibraryResponse200TypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetLibraryItemsLibraryResponse200Type other = (GetLibraryItemsLibraryResponse200Type) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetLibraryItemsLibraryResponse200Type [value=" + value + "]";
}
// return an array just like an enum
public static GetLibraryItemsLibraryResponse200Type[] values() {
synchronized (GetLibraryItemsLibraryResponse200Type.class) {
return values.values().toArray(new GetLibraryItemsLibraryResponse200Type[] {});
}
}
private static final Map<String, GetLibraryItemsLibraryResponse200Type> createValuesMap() {
Map<String, GetLibraryItemsLibraryResponse200Type> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetLibraryItemsLibraryResponse200TypeEnum> createEnumsMap() {
Map<String, GetLibraryItemsLibraryResponse200TypeEnum> map = new HashMap<>();
map.put("coverPoster", GetLibraryItemsLibraryResponse200TypeEnum.COVER_POSTER);
map.put("background", GetLibraryItemsLibraryResponse200TypeEnum.BACKGROUND);
map.put("snapshot", GetLibraryItemsLibraryResponse200TypeEnum.SNAPSHOT);
map.put("clearLogo", GetLibraryItemsLibraryResponse200TypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetLibraryItemsLibraryResponse200Type> {
protected _Serializer() {
super(GetLibraryItemsLibraryResponse200Type.class);
}
@Override
public void serialize(GetLibraryItemsLibraryResponse200Type value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetLibraryItemsLibraryResponse200Type> {
protected _Deserializer() {
super(GetLibraryItemsLibraryResponse200Type.class);
}
@Override
public GetLibraryItemsLibraryResponse200Type deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetLibraryItemsLibraryResponse200Type.of(v);
}
}
public enum GetLibraryItemsLibraryResponse200TypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetLibraryItemsLibraryResponse200TypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetLibraryItemsLibraryType
*
* <p>The type of media content
*/
public enum GetLibraryItemsLibraryType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetLibraryItemsLibraryType._Deserializer.class)
@JsonSerialize(using = GetLibraryItemsLibraryType._Serializer.class)
public class GetLibraryItemsLibraryType {
public static final GetLibraryItemsLibraryType Movie = new GetLibraryItemsLibraryType("movie");
public static final GetLibraryItemsLibraryType TvShow = new GetLibraryItemsLibraryType("show");
public static final GetLibraryItemsLibraryType Season = new GetLibraryItemsLibraryType("season");
public static final GetLibraryItemsLibraryType Episode = new GetLibraryItemsLibraryType("episode");
public static final GetLibraryItemsLibraryType Artist = new GetLibraryItemsLibraryType("artist");
public static final GetLibraryItemsLibraryType Album = new GetLibraryItemsLibraryType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetLibraryItemsLibraryType> values = createValuesMap();
private static final Map<String, GetLibraryItemsLibraryTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetLibraryItemsLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetLibraryItemsLibraryType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetLibraryItemsLibraryType
*/
public static GetLibraryItemsLibraryType of(String value) {
synchronized (GetLibraryItemsLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetLibraryItemsLibraryType(v));
}
}
public String value() {
return value;
}
public static Optional<GetLibraryItemsLibraryType> fromValue(String value) {
for (GetLibraryItemsLibraryType o: GetLibraryItemsLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetLibraryItemsLibraryTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetLibraryItemsLibraryType other = (GetLibraryItemsLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetLibraryItemsLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetLibraryItemsLibraryType[] values() {
synchronized (GetLibraryItemsLibraryType.class) {
return values.values().toArray(new GetLibraryItemsLibraryType[] {});
}
}
private static final Map<String, GetLibraryItemsLibraryType> createValuesMap() {
Map<String, GetLibraryItemsLibraryType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetLibraryItemsLibraryTypeEnum> createEnumsMap() {
Map<String, GetLibraryItemsLibraryTypeEnum> map = new HashMap<>();
map.put("movie", GetLibraryItemsLibraryTypeEnum.Movie);
map.put("show", GetLibraryItemsLibraryTypeEnum.TvShow);
map.put("season", GetLibraryItemsLibraryTypeEnum.Season);
map.put("episode", GetLibraryItemsLibraryTypeEnum.Episode);
map.put("artist", GetLibraryItemsLibraryTypeEnum.Artist);
map.put("album", GetLibraryItemsLibraryTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetLibraryItemsLibraryType> {
protected _Serializer() {
super(GetLibraryItemsLibraryType.class);
}
@Override
public void serialize(GetLibraryItemsLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetLibraryItemsLibraryType> {
protected _Deserializer() {
super(GetLibraryItemsLibraryType.class);
}
@Override
public GetLibraryItemsLibraryType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetLibraryItemsLibraryType.of(v);
}
}
public enum GetLibraryItemsLibraryTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetLibraryItemsLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetLibraryItemsQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetLibraryItemsQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetLibraryItemsQueryParamType._Deserializer.class)
@JsonSerialize(using = GetLibraryItemsQueryParamType._Serializer.class)
public class GetLibraryItemsQueryParamType {
public static final GetLibraryItemsQueryParamType Movie = new GetLibraryItemsQueryParamType(1L);
public static final GetLibraryItemsQueryParamType TvShow = new GetLibraryItemsQueryParamType(2L);
public static final GetLibraryItemsQueryParamType Season = new GetLibraryItemsQueryParamType(3L);
public static final GetLibraryItemsQueryParamType Episode = new GetLibraryItemsQueryParamType(4L);
public static final GetLibraryItemsQueryParamType Audio = new GetLibraryItemsQueryParamType(8L);
public static final GetLibraryItemsQueryParamType Album = new GetLibraryItemsQueryParamType(9L);
public static final GetLibraryItemsQueryParamType Track = new GetLibraryItemsQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetLibraryItemsQueryParamType> values = createValuesMap();
private static final Map<Long, GetLibraryItemsQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetLibraryItemsQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetLibraryItemsQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetLibraryItemsQueryParamType
*/
public static GetLibraryItemsQueryParamType of(long value) {
synchronized (GetLibraryItemsQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetLibraryItemsQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetLibraryItemsQueryParamType> fromValue(long value) {
for (GetLibraryItemsQueryParamType o: GetLibraryItemsQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetLibraryItemsQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetLibraryItemsQueryParamType other = (GetLibraryItemsQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetLibraryItemsQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetLibraryItemsQueryParamType[] values() {
synchronized (GetLibraryItemsQueryParamType.class) {
return values.values().toArray(new GetLibraryItemsQueryParamType[] {});
}
}
private static final Map<Long, GetLibraryItemsQueryParamType> createValuesMap() {
Map<Long, GetLibraryItemsQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetLibraryItemsQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetLibraryItemsQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetLibraryItemsQueryParamTypeEnum.Movie);
map.put(2L, GetLibraryItemsQueryParamTypeEnum.TvShow);
map.put(3L, GetLibraryItemsQueryParamTypeEnum.Season);
map.put(4L, GetLibraryItemsQueryParamTypeEnum.Episode);
map.put(8L, GetLibraryItemsQueryParamTypeEnum.Audio);
map.put(9L, GetLibraryItemsQueryParamTypeEnum.Album);
map.put(10L, GetLibraryItemsQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetLibraryItemsQueryParamType> {
protected _Serializer() {
super(GetLibraryItemsQueryParamType.class);
}
@Override
public void serialize(GetLibraryItemsQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetLibraryItemsQueryParamType> {
protected _Deserializer() {
super(GetLibraryItemsQueryParamType.class);
}
@Override
public GetLibraryItemsQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetLibraryItemsQueryParamType.of(v);
}
}
public enum GetLibraryItemsQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetLibraryItemsQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetPlaylistContentsQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetPlaylistContentsQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetPlaylistContentsQueryParamType._Deserializer.class)
@JsonSerialize(using = GetPlaylistContentsQueryParamType._Serializer.class)
public class GetPlaylistContentsQueryParamType {
public static final GetPlaylistContentsQueryParamType Movie = new GetPlaylistContentsQueryParamType(1L);
public static final GetPlaylistContentsQueryParamType TvShow = new GetPlaylistContentsQueryParamType(2L);
public static final GetPlaylistContentsQueryParamType Season = new GetPlaylistContentsQueryParamType(3L);
public static final GetPlaylistContentsQueryParamType Episode = new GetPlaylistContentsQueryParamType(4L);
public static final GetPlaylistContentsQueryParamType Audio = new GetPlaylistContentsQueryParamType(8L);
public static final GetPlaylistContentsQueryParamType Album = new GetPlaylistContentsQueryParamType(9L);
public static final GetPlaylistContentsQueryParamType Track = new GetPlaylistContentsQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetPlaylistContentsQueryParamType> values = createValuesMap();
private static final Map<Long, GetPlaylistContentsQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetPlaylistContentsQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetPlaylistContentsQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetPlaylistContentsQueryParamType
*/
public static GetPlaylistContentsQueryParamType of(long value) {
synchronized (GetPlaylistContentsQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetPlaylistContentsQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetPlaylistContentsQueryParamType> fromValue(long value) {
for (GetPlaylistContentsQueryParamType o: GetPlaylistContentsQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetPlaylistContentsQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetPlaylistContentsQueryParamType other = (GetPlaylistContentsQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetPlaylistContentsQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetPlaylistContentsQueryParamType[] values() {
synchronized (GetPlaylistContentsQueryParamType.class) {
return values.values().toArray(new GetPlaylistContentsQueryParamType[] {});
}
}
private static final Map<Long, GetPlaylistContentsQueryParamType> createValuesMap() {
Map<Long, GetPlaylistContentsQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetPlaylistContentsQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetPlaylistContentsQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetPlaylistContentsQueryParamTypeEnum.Movie);
map.put(2L, GetPlaylistContentsQueryParamTypeEnum.TvShow);
map.put(3L, GetPlaylistContentsQueryParamTypeEnum.Season);
map.put(4L, GetPlaylistContentsQueryParamTypeEnum.Episode);
map.put(8L, GetPlaylistContentsQueryParamTypeEnum.Audio);
map.put(9L, GetPlaylistContentsQueryParamTypeEnum.Album);
map.put(10L, GetPlaylistContentsQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetPlaylistContentsQueryParamType> {
protected _Serializer() {
super(GetPlaylistContentsQueryParamType.class);
}
@Override
public void serialize(GetPlaylistContentsQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetPlaylistContentsQueryParamType> {
protected _Deserializer() {
super(GetPlaylistContentsQueryParamType.class);
}
@Override
public GetPlaylistContentsQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetPlaylistContentsQueryParamType.of(v);
}
}
public enum GetPlaylistContentsQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetPlaylistContentsQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetRecentlyAddedHubsResponseType {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetRecentlyAddedHubsResponseType._Deserializer.class)
@JsonSerialize(using = GetRecentlyAddedHubsResponseType._Serializer.class)
public class GetRecentlyAddedHubsResponseType {
public static final GetRecentlyAddedHubsResponseType COVER_POSTER = new GetRecentlyAddedHubsResponseType("coverPoster");
public static final GetRecentlyAddedHubsResponseType BACKGROUND = new GetRecentlyAddedHubsResponseType("background");
public static final GetRecentlyAddedHubsResponseType SNAPSHOT = new GetRecentlyAddedHubsResponseType("snapshot");
public static final GetRecentlyAddedHubsResponseType CLEAR_LOGO = new GetRecentlyAddedHubsResponseType("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetRecentlyAddedHubsResponseType> values = createValuesMap();
private static final Map<String, GetRecentlyAddedHubsResponseTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetRecentlyAddedHubsResponseType(String value) {
this.value = value;
}
/**
* Returns a GetRecentlyAddedHubsResponseType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetRecentlyAddedHubsResponseType
*/
public static GetRecentlyAddedHubsResponseType of(String value) {
synchronized (GetRecentlyAddedHubsResponseType.class) {
return values.computeIfAbsent(value, v -> new GetRecentlyAddedHubsResponseType(v));
}
}
public String value() {
return value;
}
public static Optional<GetRecentlyAddedHubsResponseType> fromValue(String value) {
for (GetRecentlyAddedHubsResponseType o: GetRecentlyAddedHubsResponseType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetRecentlyAddedHubsResponseTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetRecentlyAddedHubsResponseType other = (GetRecentlyAddedHubsResponseType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetRecentlyAddedHubsResponseType [value=" + value + "]";
}
// return an array just like an enum
public static GetRecentlyAddedHubsResponseType[] values() {
synchronized (GetRecentlyAddedHubsResponseType.class) {
return values.values().toArray(new GetRecentlyAddedHubsResponseType[] {});
}
}
private static final Map<String, GetRecentlyAddedHubsResponseType> createValuesMap() {
Map<String, GetRecentlyAddedHubsResponseType> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetRecentlyAddedHubsResponseTypeEnum> createEnumsMap() {
Map<String, GetRecentlyAddedHubsResponseTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetRecentlyAddedHubsResponseTypeEnum.COVER_POSTER);
map.put("background", GetRecentlyAddedHubsResponseTypeEnum.BACKGROUND);
map.put("snapshot", GetRecentlyAddedHubsResponseTypeEnum.SNAPSHOT);
map.put("clearLogo", GetRecentlyAddedHubsResponseTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetRecentlyAddedHubsResponseType> {
protected _Serializer() {
super(GetRecentlyAddedHubsResponseType.class);
}
@Override
public void serialize(GetRecentlyAddedHubsResponseType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetRecentlyAddedHubsResponseType> {
protected _Deserializer() {
super(GetRecentlyAddedHubsResponseType.class);
}
@Override
public GetRecentlyAddedHubsResponseType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetRecentlyAddedHubsResponseType.of(v);
}
}
public enum GetRecentlyAddedHubsResponseTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetRecentlyAddedHubsResponseTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetRecentlyAddedHubsType
*
* <p>The type of media content
*/
public enum GetRecentlyAddedHubsType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetRecentlyAddedHubsType._Deserializer.class)
@JsonSerialize(using = GetRecentlyAddedHubsType._Serializer.class)
public class GetRecentlyAddedHubsType {
public static final GetRecentlyAddedHubsType Movie = new GetRecentlyAddedHubsType("movie");
public static final GetRecentlyAddedHubsType TvShow = new GetRecentlyAddedHubsType("show");
public static final GetRecentlyAddedHubsType Season = new GetRecentlyAddedHubsType("season");
public static final GetRecentlyAddedHubsType Episode = new GetRecentlyAddedHubsType("episode");
public static final GetRecentlyAddedHubsType Artist = new GetRecentlyAddedHubsType("artist");
public static final GetRecentlyAddedHubsType Album = new GetRecentlyAddedHubsType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetRecentlyAddedHubsType> values = createValuesMap();
private static final Map<String, GetRecentlyAddedHubsTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetRecentlyAddedHubsType(String value) {
this.value = value;
}
/**
* Returns a GetRecentlyAddedHubsType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetRecentlyAddedHubsType
*/
public static GetRecentlyAddedHubsType of(String value) {
synchronized (GetRecentlyAddedHubsType.class) {
return values.computeIfAbsent(value, v -> new GetRecentlyAddedHubsType(v));
}
}
public String value() {
return value;
}
public static Optional<GetRecentlyAddedHubsType> fromValue(String value) {
for (GetRecentlyAddedHubsType o: GetRecentlyAddedHubsType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetRecentlyAddedHubsTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetRecentlyAddedHubsType other = (GetRecentlyAddedHubsType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetRecentlyAddedHubsType [value=" + value + "]";
}
// return an array just like an enum
public static GetRecentlyAddedHubsType[] values() {
synchronized (GetRecentlyAddedHubsType.class) {
return values.values().toArray(new GetRecentlyAddedHubsType[] {});
}
}
private static final Map<String, GetRecentlyAddedHubsType> createValuesMap() {
Map<String, GetRecentlyAddedHubsType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetRecentlyAddedHubsTypeEnum> createEnumsMap() {
Map<String, GetRecentlyAddedHubsTypeEnum> map = new HashMap<>();
map.put("movie", GetRecentlyAddedHubsTypeEnum.Movie);
map.put("show", GetRecentlyAddedHubsTypeEnum.TvShow);
map.put("season", GetRecentlyAddedHubsTypeEnum.Season);
map.put("episode", GetRecentlyAddedHubsTypeEnum.Episode);
map.put("artist", GetRecentlyAddedHubsTypeEnum.Artist);
map.put("album", GetRecentlyAddedHubsTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetRecentlyAddedHubsType> {
protected _Serializer() {
super(GetRecentlyAddedHubsType.class);
}
@Override
public void serialize(GetRecentlyAddedHubsType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetRecentlyAddedHubsType> {
protected _Deserializer() {
super(GetRecentlyAddedHubsType.class);
}
@Override
public GetRecentlyAddedHubsType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetRecentlyAddedHubsType.of(v);
}
}
public enum GetRecentlyAddedHubsTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetRecentlyAddedHubsTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesEnableCreditsMarkerGeneration
*
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public enum GetSearchAllLibrariesEnableCreditsMarkerGeneration {
LibraryDefault("-1"),
Disabled("0");
@JsonDeserialize(using = GetSearchAllLibrariesEnableCreditsMarkerGeneration._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesEnableCreditsMarkerGeneration._Serializer.class)
public class GetSearchAllLibrariesEnableCreditsMarkerGeneration {
public static final GetSearchAllLibrariesEnableCreditsMarkerGeneration LibraryDefault = new GetSearchAllLibrariesEnableCreditsMarkerGeneration("-1");
public static final GetSearchAllLibrariesEnableCreditsMarkerGeneration Disabled = new GetSearchAllLibrariesEnableCreditsMarkerGeneration("0");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGeneration> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesEnableCreditsMarkerGeneration(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesEnableCreditsMarkerGeneration with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesEnableCreditsMarkerGeneration
*/
public static GetSearchAllLibrariesEnableCreditsMarkerGeneration of(String value) {
synchronized (GetSearchAllLibrariesEnableCreditsMarkerGeneration.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesEnableCreditsMarkerGeneration(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesEnableCreditsMarkerGeneration> fromValue(String value) {
for (GetSearchAllLibrariesEnableCreditsMarkerGeneration o: GetSearchAllLibrariesEnableCreditsMarkerGeneration.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesEnableCreditsMarkerGeneration other = (GetSearchAllLibrariesEnableCreditsMarkerGeneration) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesEnableCreditsMarkerGeneration [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesEnableCreditsMarkerGeneration[] values() {
synchronized (GetSearchAllLibrariesEnableCreditsMarkerGeneration.class) {
return values.values().toArray(new GetSearchAllLibrariesEnableCreditsMarkerGeneration[] {});
}
}
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGeneration> createValuesMap() {
Map<String, GetSearchAllLibrariesEnableCreditsMarkerGeneration> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Disabled);
return map;
}
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> map = new HashMap<>();
map.put("-1", GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum.LibraryDefault);
map.put("0", GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum.Disabled);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesEnableCreditsMarkerGeneration> {
protected _Serializer() {
super(GetSearchAllLibrariesEnableCreditsMarkerGeneration.class);
}
@Override
public void serialize(GetSearchAllLibrariesEnableCreditsMarkerGeneration value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesEnableCreditsMarkerGeneration> {
protected _Deserializer() {
super(GetSearchAllLibrariesEnableCreditsMarkerGeneration.class);
}
@Override
public GetSearchAllLibrariesEnableCreditsMarkerGeneration deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesEnableCreditsMarkerGeneration.of(v);
}
}
public enum GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum {
LibraryDefault("-1"),
Disabled("0"),;
private final String value;
private GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesEpisodeSort
*
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public enum GetSearchAllLibrariesEpisodeSort {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1");
@JsonDeserialize(using = GetSearchAllLibrariesEpisodeSort._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesEpisodeSort._Serializer.class)
public class GetSearchAllLibrariesEpisodeSort {
public static final GetSearchAllLibrariesEpisodeSort LibraryDefault = new GetSearchAllLibrariesEpisodeSort("-1");
public static final GetSearchAllLibrariesEpisodeSort OldestFirst = new GetSearchAllLibrariesEpisodeSort("0");
public static final GetSearchAllLibrariesEpisodeSort NewestFirst = new GetSearchAllLibrariesEpisodeSort("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesEpisodeSort> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesEpisodeSortEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesEpisodeSort(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesEpisodeSort with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesEpisodeSort
*/
public static GetSearchAllLibrariesEpisodeSort of(String value) {
synchronized (GetSearchAllLibrariesEpisodeSort.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesEpisodeSort(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesEpisodeSort> fromValue(String value) {
for (GetSearchAllLibrariesEpisodeSort o: GetSearchAllLibrariesEpisodeSort.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesEpisodeSortEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesEpisodeSort other = (GetSearchAllLibrariesEpisodeSort) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesEpisodeSort [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesEpisodeSort[] values() {
synchronized (GetSearchAllLibrariesEpisodeSort.class) {
return values.values().toArray(new GetSearchAllLibrariesEpisodeSort[] {});
}
}
private static final Map<String, GetSearchAllLibrariesEpisodeSort> createValuesMap() {
Map<String, GetSearchAllLibrariesEpisodeSort> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", OldestFirst);
map.put("1", NewestFirst);
return map;
}
private static final Map<String, GetSearchAllLibrariesEpisodeSortEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesEpisodeSortEnum> map = new HashMap<>();
map.put("-1", GetSearchAllLibrariesEpisodeSortEnum.LibraryDefault);
map.put("0", GetSearchAllLibrariesEpisodeSortEnum.OldestFirst);
map.put("1", GetSearchAllLibrariesEpisodeSortEnum.NewestFirst);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesEpisodeSort> {
protected _Serializer() {
super(GetSearchAllLibrariesEpisodeSort.class);
}
@Override
public void serialize(GetSearchAllLibrariesEpisodeSort value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesEpisodeSort> {
protected _Deserializer() {
super(GetSearchAllLibrariesEpisodeSort.class);
}
@Override
public GetSearchAllLibrariesEpisodeSort deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesEpisodeSort.of(v);
}
}
public enum GetSearchAllLibrariesEpisodeSortEnum {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1"),;
private final String value;
private GetSearchAllLibrariesEpisodeSortEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesFlattenSeasons
*
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public enum GetSearchAllLibrariesFlattenSeasons {
LibraryDefault("-1"),
Hide("0"),
Show("1");
@JsonDeserialize(using = GetSearchAllLibrariesFlattenSeasons._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesFlattenSeasons._Serializer.class)
public class GetSearchAllLibrariesFlattenSeasons {
public static final GetSearchAllLibrariesFlattenSeasons LibraryDefault = new GetSearchAllLibrariesFlattenSeasons("-1");
public static final GetSearchAllLibrariesFlattenSeasons Hide = new GetSearchAllLibrariesFlattenSeasons("0");
public static final GetSearchAllLibrariesFlattenSeasons Show = new GetSearchAllLibrariesFlattenSeasons("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesFlattenSeasons> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesFlattenSeasonsEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesFlattenSeasons(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesFlattenSeasons with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesFlattenSeasons
*/
public static GetSearchAllLibrariesFlattenSeasons of(String value) {
synchronized (GetSearchAllLibrariesFlattenSeasons.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesFlattenSeasons(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesFlattenSeasons> fromValue(String value) {
for (GetSearchAllLibrariesFlattenSeasons o: GetSearchAllLibrariesFlattenSeasons.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesFlattenSeasonsEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesFlattenSeasons other = (GetSearchAllLibrariesFlattenSeasons) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesFlattenSeasons [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesFlattenSeasons[] values() {
synchronized (GetSearchAllLibrariesFlattenSeasons.class) {
return values.values().toArray(new GetSearchAllLibrariesFlattenSeasons[] {});
}
}
private static final Map<String, GetSearchAllLibrariesFlattenSeasons> createValuesMap() {
Map<String, GetSearchAllLibrariesFlattenSeasons> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Hide);
map.put("1", Show);
return map;
}
private static final Map<String, GetSearchAllLibrariesFlattenSeasonsEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesFlattenSeasonsEnum> map = new HashMap<>();
map.put("-1", GetSearchAllLibrariesFlattenSeasonsEnum.LibraryDefault);
map.put("0", GetSearchAllLibrariesFlattenSeasonsEnum.Hide);
map.put("1", GetSearchAllLibrariesFlattenSeasonsEnum.Show);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesFlattenSeasons> {
protected _Serializer() {
super(GetSearchAllLibrariesFlattenSeasons.class);
}
@Override
public void serialize(GetSearchAllLibrariesFlattenSeasons value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesFlattenSeasons> {
protected _Deserializer() {
super(GetSearchAllLibrariesFlattenSeasons.class);
}
@Override
public GetSearchAllLibrariesFlattenSeasons deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesFlattenSeasons.of(v);
}
}
public enum GetSearchAllLibrariesFlattenSeasonsEnum {
LibraryDefault("-1"),
Hide("0"),
Show("1"),;
private final String value;
private GetSearchAllLibrariesFlattenSeasonsEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetSearchAllLibrariesLibraryType {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetSearchAllLibrariesLibraryType._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesLibraryType._Serializer.class)
public class GetSearchAllLibrariesLibraryType {
public static final GetSearchAllLibrariesLibraryType COVER_POSTER = new GetSearchAllLibrariesLibraryType("coverPoster");
public static final GetSearchAllLibrariesLibraryType BACKGROUND = new GetSearchAllLibrariesLibraryType("background");
public static final GetSearchAllLibrariesLibraryType SNAPSHOT = new GetSearchAllLibrariesLibraryType("snapshot");
public static final GetSearchAllLibrariesLibraryType CLEAR_LOGO = new GetSearchAllLibrariesLibraryType("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesLibraryType> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesLibraryTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesLibraryType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesLibraryType
*/
public static GetSearchAllLibrariesLibraryType of(String value) {
synchronized (GetSearchAllLibrariesLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesLibraryType(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesLibraryType> fromValue(String value) {
for (GetSearchAllLibrariesLibraryType o: GetSearchAllLibrariesLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesLibraryTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesLibraryType other = (GetSearchAllLibrariesLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesLibraryType[] values() {
synchronized (GetSearchAllLibrariesLibraryType.class) {
return values.values().toArray(new GetSearchAllLibrariesLibraryType[] {});
}
}
private static final Map<String, GetSearchAllLibrariesLibraryType> createValuesMap() {
Map<String, GetSearchAllLibrariesLibraryType> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetSearchAllLibrariesLibraryTypeEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesLibraryTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetSearchAllLibrariesLibraryTypeEnum.COVER_POSTER);
map.put("background", GetSearchAllLibrariesLibraryTypeEnum.BACKGROUND);
map.put("snapshot", GetSearchAllLibrariesLibraryTypeEnum.SNAPSHOT);
map.put("clearLogo", GetSearchAllLibrariesLibraryTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesLibraryType> {
protected _Serializer() {
super(GetSearchAllLibrariesLibraryType.class);
}
@Override
public void serialize(GetSearchAllLibrariesLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesLibraryType> {
protected _Deserializer() {
super(GetSearchAllLibrariesLibraryType.class);
}
@Override
public GetSearchAllLibrariesLibraryType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesLibraryType.of(v);
}
}
public enum GetSearchAllLibrariesLibraryTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetSearchAllLibrariesLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,11 +3,44 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesShowOrdering
*
@@ -18,31 +51,151 @@ import java.util.Optional;
* dvd = TheTVDB (DVD),
* absolute = TheTVDB (Absolute)).
*/
public enum GetSearchAllLibrariesShowOrdering {
None("None"),
TmdbAiring("tmdbAiring"),
TvdbAired("aired"),
TvdbDvd("dvd"),
TvdbAbsolute("absolute");
@JsonDeserialize(using = GetSearchAllLibrariesShowOrdering._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesShowOrdering._Serializer.class)
public class GetSearchAllLibrariesShowOrdering {
public static final GetSearchAllLibrariesShowOrdering None = new GetSearchAllLibrariesShowOrdering("None");
public static final GetSearchAllLibrariesShowOrdering TmdbAiring = new GetSearchAllLibrariesShowOrdering("tmdbAiring");
public static final GetSearchAllLibrariesShowOrdering TvdbAired = new GetSearchAllLibrariesShowOrdering("aired");
public static final GetSearchAllLibrariesShowOrdering TvdbDvd = new GetSearchAllLibrariesShowOrdering("dvd");
public static final GetSearchAllLibrariesShowOrdering TvdbAbsolute = new GetSearchAllLibrariesShowOrdering("absolute");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesShowOrdering> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesShowOrderingEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesShowOrdering(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesShowOrdering with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesShowOrdering
*/
public static GetSearchAllLibrariesShowOrdering of(String value) {
synchronized (GetSearchAllLibrariesShowOrdering.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesShowOrdering(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesShowOrdering> fromValue(String value) {
for (GetSearchAllLibrariesShowOrdering o: GetSearchAllLibrariesShowOrdering.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesShowOrderingEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesShowOrdering other = (GetSearchAllLibrariesShowOrdering) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesShowOrdering [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesShowOrdering[] values() {
synchronized (GetSearchAllLibrariesShowOrdering.class) {
return values.values().toArray(new GetSearchAllLibrariesShowOrdering[] {});
}
}
private static final Map<String, GetSearchAllLibrariesShowOrdering> createValuesMap() {
Map<String, GetSearchAllLibrariesShowOrdering> map = new LinkedHashMap<>();
map.put("None", None);
map.put("tmdbAiring", TmdbAiring);
map.put("aired", TvdbAired);
map.put("dvd", TvdbDvd);
map.put("absolute", TvdbAbsolute);
return map;
}
private static final Map<String, GetSearchAllLibrariesShowOrderingEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesShowOrderingEnum> map = new HashMap<>();
map.put("None", GetSearchAllLibrariesShowOrderingEnum.None);
map.put("tmdbAiring", GetSearchAllLibrariesShowOrderingEnum.TmdbAiring);
map.put("aired", GetSearchAllLibrariesShowOrderingEnum.TvdbAired);
map.put("dvd", GetSearchAllLibrariesShowOrderingEnum.TvdbDvd);
map.put("absolute", GetSearchAllLibrariesShowOrderingEnum.TvdbAbsolute);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesShowOrdering> {
protected _Serializer() {
super(GetSearchAllLibrariesShowOrdering.class);
}
@Override
public void serialize(GetSearchAllLibrariesShowOrdering value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesShowOrdering> {
protected _Deserializer() {
super(GetSearchAllLibrariesShowOrdering.class);
}
@Override
public GetSearchAllLibrariesShowOrdering deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesShowOrdering.of(v);
}
}
public enum GetSearchAllLibrariesShowOrderingEnum {
None("None"),
TmdbAiring("tmdbAiring"),
TvdbAired("aired"),
TvdbDvd("dvd"),
TvdbAbsolute("absolute"),;
private final String value;
private GetSearchAllLibrariesShowOrderingEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesType
*
* <p>The type of media content
*/
public enum GetSearchAllLibrariesType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetSearchAllLibrariesType._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesType._Serializer.class)
public class GetSearchAllLibrariesType {
public static final GetSearchAllLibrariesType Movie = new GetSearchAllLibrariesType("movie");
public static final GetSearchAllLibrariesType TvShow = new GetSearchAllLibrariesType("show");
public static final GetSearchAllLibrariesType Season = new GetSearchAllLibrariesType("season");
public static final GetSearchAllLibrariesType Episode = new GetSearchAllLibrariesType("episode");
public static final GetSearchAllLibrariesType Artist = new GetSearchAllLibrariesType("artist");
public static final GetSearchAllLibrariesType Album = new GetSearchAllLibrariesType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesType> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesType(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesType
*/
public static GetSearchAllLibrariesType of(String value) {
synchronized (GetSearchAllLibrariesType.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesType(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesType> fromValue(String value) {
for (GetSearchAllLibrariesType o: GetSearchAllLibrariesType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesType other = (GetSearchAllLibrariesType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesType [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesType[] values() {
synchronized (GetSearchAllLibrariesType.class) {
return values.values().toArray(new GetSearchAllLibrariesType[] {});
}
}
private static final Map<String, GetSearchAllLibrariesType> createValuesMap() {
Map<String, GetSearchAllLibrariesType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetSearchAllLibrariesTypeEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesTypeEnum> map = new HashMap<>();
map.put("movie", GetSearchAllLibrariesTypeEnum.Movie);
map.put("show", GetSearchAllLibrariesTypeEnum.TvShow);
map.put("season", GetSearchAllLibrariesTypeEnum.Season);
map.put("episode", GetSearchAllLibrariesTypeEnum.Episode);
map.put("artist", GetSearchAllLibrariesTypeEnum.Artist);
map.put("album", GetSearchAllLibrariesTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesType> {
protected _Serializer() {
super(GetSearchAllLibrariesType.class);
}
@Override
public void serialize(GetSearchAllLibrariesType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesType> {
protected _Deserializer() {
super(GetSearchAllLibrariesType.class);
}
@Override
public GetSearchAllLibrariesType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesType.of(v);
}
}
public enum GetSearchAllLibrariesTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetSearchAllLibrariesTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetSearchLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetSearchLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetSearchLibraryQueryParamType._Serializer.class)
public class GetSearchLibraryQueryParamType {
public static final GetSearchLibraryQueryParamType Movie = new GetSearchLibraryQueryParamType(1L);
public static final GetSearchLibraryQueryParamType TvShow = new GetSearchLibraryQueryParamType(2L);
public static final GetSearchLibraryQueryParamType Season = new GetSearchLibraryQueryParamType(3L);
public static final GetSearchLibraryQueryParamType Episode = new GetSearchLibraryQueryParamType(4L);
public static final GetSearchLibraryQueryParamType Audio = new GetSearchLibraryQueryParamType(8L);
public static final GetSearchLibraryQueryParamType Album = new GetSearchLibraryQueryParamType(9L);
public static final GetSearchLibraryQueryParamType Track = new GetSearchLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetSearchLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetSearchLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetSearchLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetSearchLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchLibraryQueryParamType
*/
public static GetSearchLibraryQueryParamType of(long value) {
synchronized (GetSearchLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetSearchLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetSearchLibraryQueryParamType> fromValue(long value) {
for (GetSearchLibraryQueryParamType o: GetSearchLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchLibraryQueryParamType other = (GetSearchLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchLibraryQueryParamType[] values() {
synchronized (GetSearchLibraryQueryParamType.class) {
return values.values().toArray(new GetSearchLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetSearchLibraryQueryParamType> createValuesMap() {
Map<Long, GetSearchLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetSearchLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetSearchLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetSearchLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetSearchLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetSearchLibraryQueryParamTypeEnum.Season);
map.put(4L, GetSearchLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetSearchLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetSearchLibraryQueryParamTypeEnum.Album);
map.put(10L, GetSearchLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchLibraryQueryParamType> {
protected _Serializer() {
super(GetSearchLibraryQueryParamType.class);
}
@Override
public void serialize(GetSearchLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchLibraryQueryParamType> {
protected _Deserializer() {
super(GetSearchLibraryQueryParamType.class);
}
@Override
public GetSearchLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetSearchLibraryQueryParamType.of(v);
}
}
public enum GetSearchLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetSearchLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetTokenDetailsAuthenticationResponseStatus
*
* <p>String representation of subscriptionActive
*/
public enum GetTokenDetailsAuthenticationResponseStatus {
INACTIVE("Inactive"),
ACTIVE("Active");
@JsonDeserialize(using = GetTokenDetailsAuthenticationResponseStatus._Deserializer.class)
@JsonSerialize(using = GetTokenDetailsAuthenticationResponseStatus._Serializer.class)
public class GetTokenDetailsAuthenticationResponseStatus {
public static final GetTokenDetailsAuthenticationResponseStatus INACTIVE = new GetTokenDetailsAuthenticationResponseStatus("Inactive");
public static final GetTokenDetailsAuthenticationResponseStatus ACTIVE = new GetTokenDetailsAuthenticationResponseStatus("Active");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetTokenDetailsAuthenticationResponseStatus> values = createValuesMap();
private static final Map<String, GetTokenDetailsAuthenticationResponseStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetTokenDetailsAuthenticationResponseStatus(String value) {
this.value = value;
}
/**
* Returns a GetTokenDetailsAuthenticationResponseStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetTokenDetailsAuthenticationResponseStatus
*/
public static GetTokenDetailsAuthenticationResponseStatus of(String value) {
synchronized (GetTokenDetailsAuthenticationResponseStatus.class) {
return values.computeIfAbsent(value, v -> new GetTokenDetailsAuthenticationResponseStatus(v));
}
}
public String value() {
return value;
}
public static Optional<GetTokenDetailsAuthenticationResponseStatus> fromValue(String value) {
for (GetTokenDetailsAuthenticationResponseStatus o: GetTokenDetailsAuthenticationResponseStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetTokenDetailsAuthenticationResponseStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetTokenDetailsAuthenticationResponseStatus other = (GetTokenDetailsAuthenticationResponseStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetTokenDetailsAuthenticationResponseStatus [value=" + value + "]";
}
// return an array just like an enum
public static GetTokenDetailsAuthenticationResponseStatus[] values() {
synchronized (GetTokenDetailsAuthenticationResponseStatus.class) {
return values.values().toArray(new GetTokenDetailsAuthenticationResponseStatus[] {});
}
}
private static final Map<String, GetTokenDetailsAuthenticationResponseStatus> createValuesMap() {
Map<String, GetTokenDetailsAuthenticationResponseStatus> map = new LinkedHashMap<>();
map.put("Inactive", INACTIVE);
map.put("Active", ACTIVE);
return map;
}
private static final Map<String, GetTokenDetailsAuthenticationResponseStatusEnum> createEnumsMap() {
Map<String, GetTokenDetailsAuthenticationResponseStatusEnum> map = new HashMap<>();
map.put("Inactive", GetTokenDetailsAuthenticationResponseStatusEnum.INACTIVE);
map.put("Active", GetTokenDetailsAuthenticationResponseStatusEnum.ACTIVE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetTokenDetailsAuthenticationResponseStatus> {
protected _Serializer() {
super(GetTokenDetailsAuthenticationResponseStatus.class);
}
@Override
public void serialize(GetTokenDetailsAuthenticationResponseStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsAuthenticationResponseStatus> {
protected _Deserializer() {
super(GetTokenDetailsAuthenticationResponseStatus.class);
}
@Override
public GetTokenDetailsAuthenticationResponseStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetTokenDetailsAuthenticationResponseStatus.of(v);
}
}
public enum GetTokenDetailsAuthenticationResponseStatusEnum {
INACTIVE("Inactive"),
ACTIVE("Active"),;
private final String value;
private GetTokenDetailsAuthenticationResponseStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetTokenDetailsAuthenticationStatus
*
* <p>String representation of subscriptionActive
*/
public enum GetTokenDetailsAuthenticationStatus {
INACTIVE("Inactive"),
ACTIVE("Active");
@JsonDeserialize(using = GetTokenDetailsAuthenticationStatus._Deserializer.class)
@JsonSerialize(using = GetTokenDetailsAuthenticationStatus._Serializer.class)
public class GetTokenDetailsAuthenticationStatus {
public static final GetTokenDetailsAuthenticationStatus INACTIVE = new GetTokenDetailsAuthenticationStatus("Inactive");
public static final GetTokenDetailsAuthenticationStatus ACTIVE = new GetTokenDetailsAuthenticationStatus("Active");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetTokenDetailsAuthenticationStatus> values = createValuesMap();
private static final Map<String, GetTokenDetailsAuthenticationStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetTokenDetailsAuthenticationStatus(String value) {
this.value = value;
}
/**
* Returns a GetTokenDetailsAuthenticationStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetTokenDetailsAuthenticationStatus
*/
public static GetTokenDetailsAuthenticationStatus of(String value) {
synchronized (GetTokenDetailsAuthenticationStatus.class) {
return values.computeIfAbsent(value, v -> new GetTokenDetailsAuthenticationStatus(v));
}
}
public String value() {
return value;
}
public static Optional<GetTokenDetailsAuthenticationStatus> fromValue(String value) {
for (GetTokenDetailsAuthenticationStatus o: GetTokenDetailsAuthenticationStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetTokenDetailsAuthenticationStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetTokenDetailsAuthenticationStatus other = (GetTokenDetailsAuthenticationStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetTokenDetailsAuthenticationStatus [value=" + value + "]";
}
// return an array just like an enum
public static GetTokenDetailsAuthenticationStatus[] values() {
synchronized (GetTokenDetailsAuthenticationStatus.class) {
return values.values().toArray(new GetTokenDetailsAuthenticationStatus[] {});
}
}
private static final Map<String, GetTokenDetailsAuthenticationStatus> createValuesMap() {
Map<String, GetTokenDetailsAuthenticationStatus> map = new LinkedHashMap<>();
map.put("Inactive", INACTIVE);
map.put("Active", ACTIVE);
return map;
}
private static final Map<String, GetTokenDetailsAuthenticationStatusEnum> createEnumsMap() {
Map<String, GetTokenDetailsAuthenticationStatusEnum> map = new HashMap<>();
map.put("Inactive", GetTokenDetailsAuthenticationStatusEnum.INACTIVE);
map.put("Active", GetTokenDetailsAuthenticationStatusEnum.ACTIVE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetTokenDetailsAuthenticationStatus> {
protected _Serializer() {
super(GetTokenDetailsAuthenticationStatus.class);
}
@Override
public void serialize(GetTokenDetailsAuthenticationStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsAuthenticationStatus> {
protected _Deserializer() {
super(GetTokenDetailsAuthenticationStatus.class);
}
@Override
public GetTokenDetailsAuthenticationStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetTokenDetailsAuthenticationStatus.of(v);
}
}
public enum GetTokenDetailsAuthenticationStatusEnum {
INACTIVE("Inactive"),
ACTIVE("Active"),;
private final String value;
private GetTokenDetailsAuthenticationStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,33 +3,177 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetTokenDetailsStatus {
ONLINE("online"),
OFFLINE("offline");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetTokenDetailsStatus._Deserializer.class)
@JsonSerialize(using = GetTokenDetailsStatus._Serializer.class)
public class GetTokenDetailsStatus {
public static final GetTokenDetailsStatus ONLINE = new GetTokenDetailsStatus("online");
public static final GetTokenDetailsStatus OFFLINE = new GetTokenDetailsStatus("offline");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetTokenDetailsStatus> values = createValuesMap();
private static final Map<String, GetTokenDetailsStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetTokenDetailsStatus(String value) {
this.value = value;
}
/**
* Returns a GetTokenDetailsStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetTokenDetailsStatus
*/
public static GetTokenDetailsStatus of(String value) {
synchronized (GetTokenDetailsStatus.class) {
return values.computeIfAbsent(value, v -> new GetTokenDetailsStatus(v));
}
}
public String value() {
return value;
}
public static Optional<GetTokenDetailsStatus> fromValue(String value) {
for (GetTokenDetailsStatus o: GetTokenDetailsStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetTokenDetailsStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetTokenDetailsStatus other = (GetTokenDetailsStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetTokenDetailsStatus [value=" + value + "]";
}
// return an array just like an enum
public static GetTokenDetailsStatus[] values() {
synchronized (GetTokenDetailsStatus.class) {
return values.values().toArray(new GetTokenDetailsStatus[] {});
}
}
private static final Map<String, GetTokenDetailsStatus> createValuesMap() {
Map<String, GetTokenDetailsStatus> map = new LinkedHashMap<>();
map.put("online", ONLINE);
map.put("offline", OFFLINE);
return map;
}
private static final Map<String, GetTokenDetailsStatusEnum> createEnumsMap() {
Map<String, GetTokenDetailsStatusEnum> map = new HashMap<>();
map.put("online", GetTokenDetailsStatusEnum.ONLINE);
map.put("offline", GetTokenDetailsStatusEnum.OFFLINE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetTokenDetailsStatus> {
protected _Serializer() {
super(GetTokenDetailsStatus.class);
}
@Override
public void serialize(GetTokenDetailsStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsStatus> {
protected _Deserializer() {
super(GetTokenDetailsStatus.class);
}
@Override
public GetTokenDetailsStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetTokenDetailsStatus.of(v);
}
}
public enum GetTokenDetailsStatusEnum {
ONLINE("online"),
OFFLINE("offline"),;
private final String value;
private GetTokenDetailsStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetTopWatchedContentQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetTopWatchedContentQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetTopWatchedContentQueryParamType._Deserializer.class)
@JsonSerialize(using = GetTopWatchedContentQueryParamType._Serializer.class)
public class GetTopWatchedContentQueryParamType {
public static final GetTopWatchedContentQueryParamType Movie = new GetTopWatchedContentQueryParamType(1L);
public static final GetTopWatchedContentQueryParamType TvShow = new GetTopWatchedContentQueryParamType(2L);
public static final GetTopWatchedContentQueryParamType Season = new GetTopWatchedContentQueryParamType(3L);
public static final GetTopWatchedContentQueryParamType Episode = new GetTopWatchedContentQueryParamType(4L);
public static final GetTopWatchedContentQueryParamType Audio = new GetTopWatchedContentQueryParamType(8L);
public static final GetTopWatchedContentQueryParamType Album = new GetTopWatchedContentQueryParamType(9L);
public static final GetTopWatchedContentQueryParamType Track = new GetTopWatchedContentQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetTopWatchedContentQueryParamType> values = createValuesMap();
private static final Map<Long, GetTopWatchedContentQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetTopWatchedContentQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetTopWatchedContentQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetTopWatchedContentQueryParamType
*/
public static GetTopWatchedContentQueryParamType of(long value) {
synchronized (GetTopWatchedContentQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetTopWatchedContentQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetTopWatchedContentQueryParamType> fromValue(long value) {
for (GetTopWatchedContentQueryParamType o: GetTopWatchedContentQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetTopWatchedContentQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetTopWatchedContentQueryParamType other = (GetTopWatchedContentQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetTopWatchedContentQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetTopWatchedContentQueryParamType[] values() {
synchronized (GetTopWatchedContentQueryParamType.class) {
return values.values().toArray(new GetTopWatchedContentQueryParamType[] {});
}
}
private static final Map<Long, GetTopWatchedContentQueryParamType> createValuesMap() {
Map<Long, GetTopWatchedContentQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetTopWatchedContentQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetTopWatchedContentQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetTopWatchedContentQueryParamTypeEnum.Movie);
map.put(2L, GetTopWatchedContentQueryParamTypeEnum.TvShow);
map.put(3L, GetTopWatchedContentQueryParamTypeEnum.Season);
map.put(4L, GetTopWatchedContentQueryParamTypeEnum.Episode);
map.put(8L, GetTopWatchedContentQueryParamTypeEnum.Audio);
map.put(9L, GetTopWatchedContentQueryParamTypeEnum.Album);
map.put(10L, GetTopWatchedContentQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetTopWatchedContentQueryParamType> {
protected _Serializer() {
super(GetTopWatchedContentQueryParamType.class);
}
@Override
public void serialize(GetTopWatchedContentQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetTopWatchedContentQueryParamType> {
protected _Deserializer() {
super(GetTopWatchedContentQueryParamType.class);
}
@Override
public GetTopWatchedContentQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetTopWatchedContentQueryParamType.of(v);
}
}
public enum GetTopWatchedContentQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetTopWatchedContentQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -10,7 +10,7 @@ import java.util.Optional;
/**
* IncludeDetails
*
* <p>Whether or not to include details for a section (types, filters, and sorts).
* <p>Whether or not to include details for a section (types, filters, and sorts).
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
*/
public enum IncludeDetails {

View File

@@ -3,45 +3,200 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Level
*
* <p>An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* <p>An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* 4: Verbose
*/
public enum Level {
ZERO(0L),
ONE(1L),
TWO(2L),
THREE(3L),
FOUR(4L);
@JsonDeserialize(using = Level._Deserializer.class)
@JsonSerialize(using = Level._Serializer.class)
public class Level {
public static final Level ZERO = new Level(0L);
public static final Level ONE = new Level(1L);
public static final Level TWO = new Level(2L);
public static final Level THREE = new Level(3L);
public static final Level FOUR = new Level(4L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, Level> values = createValuesMap();
private static final Map<Long, LevelEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private Level(long value) {
this.value = value;
}
/**
* Returns a Level with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Level
*/
public static Level of(long value) {
synchronized (Level.class) {
return values.computeIfAbsent(value, v -> new Level(v));
}
}
public long value() {
return value;
}
public static Optional<Level> fromValue(long value) {
for (Level o: Level.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<LevelEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Level other = (Level) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Level [value=" + value + "]";
}
// return an array just like an enum
public static Level[] values() {
synchronized (Level.class) {
return values.values().toArray(new Level[] {});
}
}
private static final Map<Long, Level> createValuesMap() {
Map<Long, Level> map = new LinkedHashMap<>();
map.put(0L, ZERO);
map.put(1L, ONE);
map.put(2L, TWO);
map.put(3L, THREE);
map.put(4L, FOUR);
return map;
}
private static final Map<Long, LevelEnum> createEnumsMap() {
Map<Long, LevelEnum> map = new HashMap<>();
map.put(0L, LevelEnum.ZERO);
map.put(1L, LevelEnum.ONE);
map.put(2L, LevelEnum.TWO);
map.put(3L, LevelEnum.THREE);
map.put(4L, LevelEnum.FOUR);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Level> {
protected _Serializer() {
super(Level.class);
}
@Override
public void serialize(Level value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Level> {
protected _Deserializer() {
super(Level.class);
}
@Override
public Level deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return Level.of(v);
}
}
public enum LevelEnum {
ZERO(0L),
ONE(1L),
TWO(2L),
THREE(3L),
FOUR(4L),;
private final long value;
private LevelEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Libtype
*
* <p>The type of library to filter. Can be "movie" or "show", or all if not present.
*/
public enum Libtype {
MOVIE("movie"),
SHOW("show");
@JsonDeserialize(using = Libtype._Deserializer.class)
@JsonSerialize(using = Libtype._Serializer.class)
public class Libtype {
public static final Libtype MOVIE = new Libtype("movie");
public static final Libtype SHOW = new Libtype("show");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, Libtype> values = createValuesMap();
private static final Map<String, LibtypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private Libtype(String value) {
this.value = value;
}
/**
* Returns a Libtype with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Libtype
*/
public static Libtype of(String value) {
synchronized (Libtype.class) {
return values.computeIfAbsent(value, v -> new Libtype(v));
}
}
public String value() {
return value;
}
public static Optional<Libtype> fromValue(String value) {
for (Libtype o: Libtype.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<LibtypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Libtype other = (Libtype) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Libtype [value=" + value + "]";
}
// return an array just like an enum
public static Libtype[] values() {
synchronized (Libtype.class) {
return values.values().toArray(new Libtype[] {});
}
}
private static final Map<String, Libtype> createValuesMap() {
Map<String, Libtype> map = new LinkedHashMap<>();
map.put("movie", MOVIE);
map.put("show", SHOW);
return map;
}
private static final Map<String, LibtypeEnum> createEnumsMap() {
Map<String, LibtypeEnum> map = new HashMap<>();
map.put("movie", LibtypeEnum.MOVIE);
map.put("show", LibtypeEnum.SHOW);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Libtype> {
protected _Serializer() {
super(Libtype.class);
}
@Override
public void serialize(Libtype value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Libtype> {
protected _Deserializer() {
super(Libtype.class);
}
@Override
public Libtype deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return Libtype.of(v);
}
}
public enum LibtypeEnum {
MOVIE("movie"),
SHOW("show"),;
private final String value;
private LibtypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -14,11 +14,11 @@ import java.util.Objects;
public class LogLineRequest {
/**
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* 4: Verbose
*/
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=level")
@@ -50,11 +50,11 @@ public class LogLineRequest {
}
/**
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* 4: Verbose
*/
@JsonIgnore
@@ -83,11 +83,11 @@ public class LogLineRequest {
}
/**
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* 4: Verbose
*/
public LogLineRequest withLevel(Level level) {
@@ -159,11 +159,11 @@ public class LogLineRequest {
}
/**
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* 4: Verbose
*/
public Builder level(Level level) {

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* MailingListStatus
*
* <p>Your current mailing list status (active or unsubscribed)
*/
public enum MailingListStatus {
ACTIVE("active"),
UNSUBSCRIBED("unsubscribed");
@JsonDeserialize(using = MailingListStatus._Deserializer.class)
@JsonSerialize(using = MailingListStatus._Serializer.class)
public class MailingListStatus {
public static final MailingListStatus ACTIVE = new MailingListStatus("active");
public static final MailingListStatus UNSUBSCRIBED = new MailingListStatus("unsubscribed");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, MailingListStatus> values = createValuesMap();
private static final Map<String, MailingListStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private MailingListStatus(String value) {
this.value = value;
}
/**
* Returns a MailingListStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as MailingListStatus
*/
public static MailingListStatus of(String value) {
synchronized (MailingListStatus.class) {
return values.computeIfAbsent(value, v -> new MailingListStatus(v));
}
}
public String value() {
return value;
}
public static Optional<MailingListStatus> fromValue(String value) {
for (MailingListStatus o: MailingListStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<MailingListStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MailingListStatus other = (MailingListStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "MailingListStatus [value=" + value + "]";
}
// return an array just like an enum
public static MailingListStatus[] values() {
synchronized (MailingListStatus.class) {
return values.values().toArray(new MailingListStatus[] {});
}
}
private static final Map<String, MailingListStatus> createValuesMap() {
Map<String, MailingListStatus> map = new LinkedHashMap<>();
map.put("active", ACTIVE);
map.put("unsubscribed", UNSUBSCRIBED);
return map;
}
private static final Map<String, MailingListStatusEnum> createEnumsMap() {
Map<String, MailingListStatusEnum> map = new HashMap<>();
map.put("active", MailingListStatusEnum.ACTIVE);
map.put("unsubscribed", MailingListStatusEnum.UNSUBSCRIBED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<MailingListStatus> {
protected _Serializer() {
super(MailingListStatus.class);
}
@Override
public void serialize(MailingListStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<MailingListStatus> {
protected _Deserializer() {
super(MailingListStatus.class);
}
@Override
public MailingListStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return MailingListStatus.of(v);
}
}
public enum MailingListStatusEnum {
ACTIVE("active"),
UNSUBSCRIBED("unsubscribed"),;
private final String value;
private MailingListStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,50 +3,230 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* PathParamTaskName
*
* <p>The name of the task to be started.
*/
public enum PathParamTaskName {
BACKUP_DATABASE("BackupDatabase"),
BUILD_GRACENOTE_COLLECTIONS("BuildGracenoteCollections"),
CHECK_FOR_UPDATES("CheckForUpdates"),
CLEAN_OLD_BUNDLES("CleanOldBundles"),
CLEAN_OLD_CACHE_FILES("CleanOldCacheFiles"),
DEEP_MEDIA_ANALYSIS("DeepMediaAnalysis"),
GENERATE_AUTO_TAGS("GenerateAutoTags"),
GENERATE_CHAPTER_THUMBS("GenerateChapterThumbs"),
GENERATE_MEDIA_INDEX_FILES("GenerateMediaIndexFiles"),
OPTIMIZE_DATABASE("OptimizeDatabase"),
REFRESH_LIBRARIES("RefreshLibraries"),
REFRESH_LOCAL_MEDIA("RefreshLocalMedia"),
REFRESH_PERIODIC_METADATA("RefreshPeriodicMetadata"),
UPGRADE_MEDIA_ANALYSIS("UpgradeMediaAnalysis");
@JsonDeserialize(using = PathParamTaskName._Deserializer.class)
@JsonSerialize(using = PathParamTaskName._Serializer.class)
public class PathParamTaskName {
public static final PathParamTaskName BACKUP_DATABASE = new PathParamTaskName("BackupDatabase");
public static final PathParamTaskName BUILD_GRACENOTE_COLLECTIONS = new PathParamTaskName("BuildGracenoteCollections");
public static final PathParamTaskName CHECK_FOR_UPDATES = new PathParamTaskName("CheckForUpdates");
public static final PathParamTaskName CLEAN_OLD_BUNDLES = new PathParamTaskName("CleanOldBundles");
public static final PathParamTaskName CLEAN_OLD_CACHE_FILES = new PathParamTaskName("CleanOldCacheFiles");
public static final PathParamTaskName DEEP_MEDIA_ANALYSIS = new PathParamTaskName("DeepMediaAnalysis");
public static final PathParamTaskName GENERATE_AUTO_TAGS = new PathParamTaskName("GenerateAutoTags");
public static final PathParamTaskName GENERATE_CHAPTER_THUMBS = new PathParamTaskName("GenerateChapterThumbs");
public static final PathParamTaskName GENERATE_MEDIA_INDEX_FILES = new PathParamTaskName("GenerateMediaIndexFiles");
public static final PathParamTaskName OPTIMIZE_DATABASE = new PathParamTaskName("OptimizeDatabase");
public static final PathParamTaskName REFRESH_LIBRARIES = new PathParamTaskName("RefreshLibraries");
public static final PathParamTaskName REFRESH_LOCAL_MEDIA = new PathParamTaskName("RefreshLocalMedia");
public static final PathParamTaskName REFRESH_PERIODIC_METADATA = new PathParamTaskName("RefreshPeriodicMetadata");
public static final PathParamTaskName UPGRADE_MEDIA_ANALYSIS = new PathParamTaskName("UpgradeMediaAnalysis");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PathParamTaskName> values = createValuesMap();
private static final Map<String, PathParamTaskNameEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PathParamTaskName(String value) {
this.value = value;
}
/**
* Returns a PathParamTaskName with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PathParamTaskName
*/
public static PathParamTaskName of(String value) {
synchronized (PathParamTaskName.class) {
return values.computeIfAbsent(value, v -> new PathParamTaskName(v));
}
}
public String value() {
return value;
}
public static Optional<PathParamTaskName> fromValue(String value) {
for (PathParamTaskName o: PathParamTaskName.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PathParamTaskNameEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PathParamTaskName other = (PathParamTaskName) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PathParamTaskName [value=" + value + "]";
}
// return an array just like an enum
public static PathParamTaskName[] values() {
synchronized (PathParamTaskName.class) {
return values.values().toArray(new PathParamTaskName[] {});
}
}
private static final Map<String, PathParamTaskName> createValuesMap() {
Map<String, PathParamTaskName> map = new LinkedHashMap<>();
map.put("BackupDatabase", BACKUP_DATABASE);
map.put("BuildGracenoteCollections", BUILD_GRACENOTE_COLLECTIONS);
map.put("CheckForUpdates", CHECK_FOR_UPDATES);
map.put("CleanOldBundles", CLEAN_OLD_BUNDLES);
map.put("CleanOldCacheFiles", CLEAN_OLD_CACHE_FILES);
map.put("DeepMediaAnalysis", DEEP_MEDIA_ANALYSIS);
map.put("GenerateAutoTags", GENERATE_AUTO_TAGS);
map.put("GenerateChapterThumbs", GENERATE_CHAPTER_THUMBS);
map.put("GenerateMediaIndexFiles", GENERATE_MEDIA_INDEX_FILES);
map.put("OptimizeDatabase", OPTIMIZE_DATABASE);
map.put("RefreshLibraries", REFRESH_LIBRARIES);
map.put("RefreshLocalMedia", REFRESH_LOCAL_MEDIA);
map.put("RefreshPeriodicMetadata", REFRESH_PERIODIC_METADATA);
map.put("UpgradeMediaAnalysis", UPGRADE_MEDIA_ANALYSIS);
return map;
}
private static final Map<String, PathParamTaskNameEnum> createEnumsMap() {
Map<String, PathParamTaskNameEnum> map = new HashMap<>();
map.put("BackupDatabase", PathParamTaskNameEnum.BACKUP_DATABASE);
map.put("BuildGracenoteCollections", PathParamTaskNameEnum.BUILD_GRACENOTE_COLLECTIONS);
map.put("CheckForUpdates", PathParamTaskNameEnum.CHECK_FOR_UPDATES);
map.put("CleanOldBundles", PathParamTaskNameEnum.CLEAN_OLD_BUNDLES);
map.put("CleanOldCacheFiles", PathParamTaskNameEnum.CLEAN_OLD_CACHE_FILES);
map.put("DeepMediaAnalysis", PathParamTaskNameEnum.DEEP_MEDIA_ANALYSIS);
map.put("GenerateAutoTags", PathParamTaskNameEnum.GENERATE_AUTO_TAGS);
map.put("GenerateChapterThumbs", PathParamTaskNameEnum.GENERATE_CHAPTER_THUMBS);
map.put("GenerateMediaIndexFiles", PathParamTaskNameEnum.GENERATE_MEDIA_INDEX_FILES);
map.put("OptimizeDatabase", PathParamTaskNameEnum.OPTIMIZE_DATABASE);
map.put("RefreshLibraries", PathParamTaskNameEnum.REFRESH_LIBRARIES);
map.put("RefreshLocalMedia", PathParamTaskNameEnum.REFRESH_LOCAL_MEDIA);
map.put("RefreshPeriodicMetadata", PathParamTaskNameEnum.REFRESH_PERIODIC_METADATA);
map.put("UpgradeMediaAnalysis", PathParamTaskNameEnum.UPGRADE_MEDIA_ANALYSIS);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PathParamTaskName> {
protected _Serializer() {
super(PathParamTaskName.class);
}
@Override
public void serialize(PathParamTaskName value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PathParamTaskName> {
protected _Deserializer() {
super(PathParamTaskName.class);
}
@Override
public PathParamTaskName deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PathParamTaskName.of(v);
}
}
public enum PathParamTaskNameEnum {
BACKUP_DATABASE("BackupDatabase"),
BUILD_GRACENOTE_COLLECTIONS("BuildGracenoteCollections"),
CHECK_FOR_UPDATES("CheckForUpdates"),
CLEAN_OLD_BUNDLES("CleanOldBundles"),
CLEAN_OLD_CACHE_FILES("CleanOldCacheFiles"),
DEEP_MEDIA_ANALYSIS("DeepMediaAnalysis"),
GENERATE_AUTO_TAGS("GenerateAutoTags"),
GENERATE_CHAPTER_THUMBS("GenerateChapterThumbs"),
GENERATE_MEDIA_INDEX_FILES("GenerateMediaIndexFiles"),
OPTIMIZE_DATABASE("OptimizeDatabase"),
REFRESH_LIBRARIES("RefreshLibraries"),
REFRESH_LOCAL_MEDIA("RefreshLocalMedia"),
REFRESH_PERIODIC_METADATA("RefreshPeriodicMetadata"),
UPGRADE_MEDIA_ANALYSIS("UpgradeMediaAnalysis"),;
private final String value;
private PathParamTaskNameEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* PlaylistType
*
* <p>limit to a type of playlist.
*/
public enum PlaylistType {
AUDIO("audio"),
VIDEO("video"),
PHOTO("photo");
@JsonDeserialize(using = PlaylistType._Deserializer.class)
@JsonSerialize(using = PlaylistType._Serializer.class)
public class PlaylistType {
public static final PlaylistType AUDIO = new PlaylistType("audio");
public static final PlaylistType VIDEO = new PlaylistType("video");
public static final PlaylistType PHOTO = new PlaylistType("photo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PlaylistType> values = createValuesMap();
private static final Map<String, PlaylistTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PlaylistType(String value) {
this.value = value;
}
/**
* Returns a PlaylistType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PlaylistType
*/
public static PlaylistType of(String value) {
synchronized (PlaylistType.class) {
return values.computeIfAbsent(value, v -> new PlaylistType(v));
}
}
public String value() {
return value;
}
public static Optional<PlaylistType> fromValue(String value) {
for (PlaylistType o: PlaylistType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PlaylistTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PlaylistType other = (PlaylistType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PlaylistType [value=" + value + "]";
}
// return an array just like an enum
public static PlaylistType[] values() {
synchronized (PlaylistType.class) {
return values.values().toArray(new PlaylistType[] {});
}
}
private static final Map<String, PlaylistType> createValuesMap() {
Map<String, PlaylistType> map = new LinkedHashMap<>();
map.put("audio", AUDIO);
map.put("video", VIDEO);
map.put("photo", PHOTO);
return map;
}
private static final Map<String, PlaylistTypeEnum> createEnumsMap() {
Map<String, PlaylistTypeEnum> map = new HashMap<>();
map.put("audio", PlaylistTypeEnum.AUDIO);
map.put("video", PlaylistTypeEnum.VIDEO);
map.put("photo", PlaylistTypeEnum.PHOTO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PlaylistType> {
protected _Serializer() {
super(PlaylistType.class);
}
@Override
public void serialize(PlaylistType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PlaylistType> {
protected _Deserializer() {
super(PlaylistType.class);
}
@Override
public PlaylistType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PlaylistType.of(v);
}
}
public enum PlaylistTypeEnum {
AUDIO("audio"),
VIDEO("video"),
PHOTO("photo"),;
private final String value;
private PlaylistTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* PostUsersSignInDataAuthenticationResponseStatus
*
* <p>String representation of subscriptionActive
*/
public enum PostUsersSignInDataAuthenticationResponseStatus {
INACTIVE("Inactive"),
ACTIVE("Active");
@JsonDeserialize(using = PostUsersSignInDataAuthenticationResponseStatus._Deserializer.class)
@JsonSerialize(using = PostUsersSignInDataAuthenticationResponseStatus._Serializer.class)
public class PostUsersSignInDataAuthenticationResponseStatus {
public static final PostUsersSignInDataAuthenticationResponseStatus INACTIVE = new PostUsersSignInDataAuthenticationResponseStatus("Inactive");
public static final PostUsersSignInDataAuthenticationResponseStatus ACTIVE = new PostUsersSignInDataAuthenticationResponseStatus("Active");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatus> values = createValuesMap();
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PostUsersSignInDataAuthenticationResponseStatus(String value) {
this.value = value;
}
/**
* Returns a PostUsersSignInDataAuthenticationResponseStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PostUsersSignInDataAuthenticationResponseStatus
*/
public static PostUsersSignInDataAuthenticationResponseStatus of(String value) {
synchronized (PostUsersSignInDataAuthenticationResponseStatus.class) {
return values.computeIfAbsent(value, v -> new PostUsersSignInDataAuthenticationResponseStatus(v));
}
}
public String value() {
return value;
}
public static Optional<PostUsersSignInDataAuthenticationResponseStatus> fromValue(String value) {
for (PostUsersSignInDataAuthenticationResponseStatus o: PostUsersSignInDataAuthenticationResponseStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PostUsersSignInDataAuthenticationResponseStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PostUsersSignInDataAuthenticationResponseStatus other = (PostUsersSignInDataAuthenticationResponseStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PostUsersSignInDataAuthenticationResponseStatus [value=" + value + "]";
}
// return an array just like an enum
public static PostUsersSignInDataAuthenticationResponseStatus[] values() {
synchronized (PostUsersSignInDataAuthenticationResponseStatus.class) {
return values.values().toArray(new PostUsersSignInDataAuthenticationResponseStatus[] {});
}
}
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatus> createValuesMap() {
Map<String, PostUsersSignInDataAuthenticationResponseStatus> map = new LinkedHashMap<>();
map.put("Inactive", INACTIVE);
map.put("Active", ACTIVE);
return map;
}
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatusEnum> createEnumsMap() {
Map<String, PostUsersSignInDataAuthenticationResponseStatusEnum> map = new HashMap<>();
map.put("Inactive", PostUsersSignInDataAuthenticationResponseStatusEnum.INACTIVE);
map.put("Active", PostUsersSignInDataAuthenticationResponseStatusEnum.ACTIVE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PostUsersSignInDataAuthenticationResponseStatus> {
protected _Serializer() {
super(PostUsersSignInDataAuthenticationResponseStatus.class);
}
@Override
public void serialize(PostUsersSignInDataAuthenticationResponseStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataAuthenticationResponseStatus> {
protected _Deserializer() {
super(PostUsersSignInDataAuthenticationResponseStatus.class);
}
@Override
public PostUsersSignInDataAuthenticationResponseStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PostUsersSignInDataAuthenticationResponseStatus.of(v);
}
}
public enum PostUsersSignInDataAuthenticationResponseStatusEnum {
INACTIVE("Inactive"),
ACTIVE("Active"),;
private final String value;
private PostUsersSignInDataAuthenticationResponseStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* PostUsersSignInDataAuthenticationStatus
*
* <p>String representation of subscriptionActive
*/
public enum PostUsersSignInDataAuthenticationStatus {
INACTIVE("Inactive"),
ACTIVE("Active");
@JsonDeserialize(using = PostUsersSignInDataAuthenticationStatus._Deserializer.class)
@JsonSerialize(using = PostUsersSignInDataAuthenticationStatus._Serializer.class)
public class PostUsersSignInDataAuthenticationStatus {
public static final PostUsersSignInDataAuthenticationStatus INACTIVE = new PostUsersSignInDataAuthenticationStatus("Inactive");
public static final PostUsersSignInDataAuthenticationStatus ACTIVE = new PostUsersSignInDataAuthenticationStatus("Active");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PostUsersSignInDataAuthenticationStatus> values = createValuesMap();
private static final Map<String, PostUsersSignInDataAuthenticationStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PostUsersSignInDataAuthenticationStatus(String value) {
this.value = value;
}
/**
* Returns a PostUsersSignInDataAuthenticationStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PostUsersSignInDataAuthenticationStatus
*/
public static PostUsersSignInDataAuthenticationStatus of(String value) {
synchronized (PostUsersSignInDataAuthenticationStatus.class) {
return values.computeIfAbsent(value, v -> new PostUsersSignInDataAuthenticationStatus(v));
}
}
public String value() {
return value;
}
public static Optional<PostUsersSignInDataAuthenticationStatus> fromValue(String value) {
for (PostUsersSignInDataAuthenticationStatus o: PostUsersSignInDataAuthenticationStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PostUsersSignInDataAuthenticationStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PostUsersSignInDataAuthenticationStatus other = (PostUsersSignInDataAuthenticationStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PostUsersSignInDataAuthenticationStatus [value=" + value + "]";
}
// return an array just like an enum
public static PostUsersSignInDataAuthenticationStatus[] values() {
synchronized (PostUsersSignInDataAuthenticationStatus.class) {
return values.values().toArray(new PostUsersSignInDataAuthenticationStatus[] {});
}
}
private static final Map<String, PostUsersSignInDataAuthenticationStatus> createValuesMap() {
Map<String, PostUsersSignInDataAuthenticationStatus> map = new LinkedHashMap<>();
map.put("Inactive", INACTIVE);
map.put("Active", ACTIVE);
return map;
}
private static final Map<String, PostUsersSignInDataAuthenticationStatusEnum> createEnumsMap() {
Map<String, PostUsersSignInDataAuthenticationStatusEnum> map = new HashMap<>();
map.put("Inactive", PostUsersSignInDataAuthenticationStatusEnum.INACTIVE);
map.put("Active", PostUsersSignInDataAuthenticationStatusEnum.ACTIVE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PostUsersSignInDataAuthenticationStatus> {
protected _Serializer() {
super(PostUsersSignInDataAuthenticationStatus.class);
}
@Override
public void serialize(PostUsersSignInDataAuthenticationStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataAuthenticationStatus> {
protected _Deserializer() {
super(PostUsersSignInDataAuthenticationStatus.class);
}
@Override
public PostUsersSignInDataAuthenticationStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PostUsersSignInDataAuthenticationStatus.of(v);
}
}
public enum PostUsersSignInDataAuthenticationStatusEnum {
INACTIVE("Inactive"),
ACTIVE("Active"),;
private final String value;
private PostUsersSignInDataAuthenticationStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* PostUsersSignInDataMailingListStatus
*
* <p>Your current mailing list status (active or unsubscribed)
*/
public enum PostUsersSignInDataMailingListStatus {
ACTIVE("active"),
UNSUBSCRIBED("unsubscribed");
@JsonDeserialize(using = PostUsersSignInDataMailingListStatus._Deserializer.class)
@JsonSerialize(using = PostUsersSignInDataMailingListStatus._Serializer.class)
public class PostUsersSignInDataMailingListStatus {
public static final PostUsersSignInDataMailingListStatus ACTIVE = new PostUsersSignInDataMailingListStatus("active");
public static final PostUsersSignInDataMailingListStatus UNSUBSCRIBED = new PostUsersSignInDataMailingListStatus("unsubscribed");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PostUsersSignInDataMailingListStatus> values = createValuesMap();
private static final Map<String, PostUsersSignInDataMailingListStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PostUsersSignInDataMailingListStatus(String value) {
this.value = value;
}
/**
* Returns a PostUsersSignInDataMailingListStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PostUsersSignInDataMailingListStatus
*/
public static PostUsersSignInDataMailingListStatus of(String value) {
synchronized (PostUsersSignInDataMailingListStatus.class) {
return values.computeIfAbsent(value, v -> new PostUsersSignInDataMailingListStatus(v));
}
}
public String value() {
return value;
}
public static Optional<PostUsersSignInDataMailingListStatus> fromValue(String value) {
for (PostUsersSignInDataMailingListStatus o: PostUsersSignInDataMailingListStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PostUsersSignInDataMailingListStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PostUsersSignInDataMailingListStatus other = (PostUsersSignInDataMailingListStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PostUsersSignInDataMailingListStatus [value=" + value + "]";
}
// return an array just like an enum
public static PostUsersSignInDataMailingListStatus[] values() {
synchronized (PostUsersSignInDataMailingListStatus.class) {
return values.values().toArray(new PostUsersSignInDataMailingListStatus[] {});
}
}
private static final Map<String, PostUsersSignInDataMailingListStatus> createValuesMap() {
Map<String, PostUsersSignInDataMailingListStatus> map = new LinkedHashMap<>();
map.put("active", ACTIVE);
map.put("unsubscribed", UNSUBSCRIBED);
return map;
}
private static final Map<String, PostUsersSignInDataMailingListStatusEnum> createEnumsMap() {
Map<String, PostUsersSignInDataMailingListStatusEnum> map = new HashMap<>();
map.put("active", PostUsersSignInDataMailingListStatusEnum.ACTIVE);
map.put("unsubscribed", PostUsersSignInDataMailingListStatusEnum.UNSUBSCRIBED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PostUsersSignInDataMailingListStatus> {
protected _Serializer() {
super(PostUsersSignInDataMailingListStatus.class);
}
@Override
public void serialize(PostUsersSignInDataMailingListStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataMailingListStatus> {
protected _Deserializer() {
super(PostUsersSignInDataMailingListStatus.class);
}
@Override
public PostUsersSignInDataMailingListStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PostUsersSignInDataMailingListStatus.of(v);
}
}
public enum PostUsersSignInDataMailingListStatusEnum {
ACTIVE("active"),
UNSUBSCRIBED("unsubscribed"),;
private final String value;
private PostUsersSignInDataMailingListStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,32 +3,173 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum PostUsersSignInDataState {
ENDED("ended");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = PostUsersSignInDataState._Deserializer.class)
@JsonSerialize(using = PostUsersSignInDataState._Serializer.class)
public class PostUsersSignInDataState {
public static final PostUsersSignInDataState ENDED = new PostUsersSignInDataState("ended");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PostUsersSignInDataState> values = createValuesMap();
private static final Map<String, PostUsersSignInDataStateEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PostUsersSignInDataState(String value) {
this.value = value;
}
/**
* Returns a PostUsersSignInDataState with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PostUsersSignInDataState
*/
public static PostUsersSignInDataState of(String value) {
synchronized (PostUsersSignInDataState.class) {
return values.computeIfAbsent(value, v -> new PostUsersSignInDataState(v));
}
}
public String value() {
return value;
}
public static Optional<PostUsersSignInDataState> fromValue(String value) {
for (PostUsersSignInDataState o: PostUsersSignInDataState.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PostUsersSignInDataStateEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PostUsersSignInDataState other = (PostUsersSignInDataState) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PostUsersSignInDataState [value=" + value + "]";
}
// return an array just like an enum
public static PostUsersSignInDataState[] values() {
synchronized (PostUsersSignInDataState.class) {
return values.values().toArray(new PostUsersSignInDataState[] {});
}
}
private static final Map<String, PostUsersSignInDataState> createValuesMap() {
Map<String, PostUsersSignInDataState> map = new LinkedHashMap<>();
map.put("ended", ENDED);
return map;
}
private static final Map<String, PostUsersSignInDataStateEnum> createEnumsMap() {
Map<String, PostUsersSignInDataStateEnum> map = new HashMap<>();
map.put("ended", PostUsersSignInDataStateEnum.ENDED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PostUsersSignInDataState> {
protected _Serializer() {
super(PostUsersSignInDataState.class);
}
@Override
public void serialize(PostUsersSignInDataState value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataState> {
protected _Deserializer() {
super(PostUsersSignInDataState.class);
}
@Override
public PostUsersSignInDataState deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PostUsersSignInDataState.of(v);
}
}
public enum PostUsersSignInDataStateEnum {
ENDED("ended"),;
private final String value;
private PostUsersSignInDataStateEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,33 +3,177 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum PostUsersSignInDataStatus {
ONLINE("online"),
OFFLINE("offline");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = PostUsersSignInDataStatus._Deserializer.class)
@JsonSerialize(using = PostUsersSignInDataStatus._Serializer.class)
public class PostUsersSignInDataStatus {
public static final PostUsersSignInDataStatus ONLINE = new PostUsersSignInDataStatus("online");
public static final PostUsersSignInDataStatus OFFLINE = new PostUsersSignInDataStatus("offline");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, PostUsersSignInDataStatus> values = createValuesMap();
private static final Map<String, PostUsersSignInDataStatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private PostUsersSignInDataStatus(String value) {
this.value = value;
}
/**
* Returns a PostUsersSignInDataStatus with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as PostUsersSignInDataStatus
*/
public static PostUsersSignInDataStatus of(String value) {
synchronized (PostUsersSignInDataStatus.class) {
return values.computeIfAbsent(value, v -> new PostUsersSignInDataStatus(v));
}
}
public String value() {
return value;
}
public static Optional<PostUsersSignInDataStatus> fromValue(String value) {
for (PostUsersSignInDataStatus o: PostUsersSignInDataStatus.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<PostUsersSignInDataStatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PostUsersSignInDataStatus other = (PostUsersSignInDataStatus) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "PostUsersSignInDataStatus [value=" + value + "]";
}
// return an array just like an enum
public static PostUsersSignInDataStatus[] values() {
synchronized (PostUsersSignInDataStatus.class) {
return values.values().toArray(new PostUsersSignInDataStatus[] {});
}
}
private static final Map<String, PostUsersSignInDataStatus> createValuesMap() {
Map<String, PostUsersSignInDataStatus> map = new LinkedHashMap<>();
map.put("online", ONLINE);
map.put("offline", OFFLINE);
return map;
}
private static final Map<String, PostUsersSignInDataStatusEnum> createEnumsMap() {
Map<String, PostUsersSignInDataStatusEnum> map = new HashMap<>();
map.put("online", PostUsersSignInDataStatusEnum.ONLINE);
map.put("offline", PostUsersSignInDataStatusEnum.OFFLINE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<PostUsersSignInDataStatus> {
protected _Serializer() {
super(PostUsersSignInDataStatus.class);
}
@Override
public void serialize(PostUsersSignInDataStatus value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataStatus> {
protected _Deserializer() {
super(PostUsersSignInDataStatus.class);
}
@Override
public PostUsersSignInDataStatus deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return PostUsersSignInDataStatus.of(v);
}
}
public enum PostUsersSignInDataStatusEnum {
ONLINE("online"),
OFFLINE("offline"),;
private final String value;
private PostUsersSignInDataStatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -10,9 +10,9 @@ import java.util.Optional;
/**
* QueryParamForce
*
* <p>Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* <p>Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
*/
public enum QueryParamForce {

View File

@@ -3,37 +3,183 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* QueryParamSmart
*
* <p>type of playlists to return (default is all).
*/
public enum QueryParamSmart {
ZERO(0L),
ONE(1L);
@JsonDeserialize(using = QueryParamSmart._Deserializer.class)
@JsonSerialize(using = QueryParamSmart._Serializer.class)
public class QueryParamSmart {
public static final QueryParamSmart ZERO = new QueryParamSmart(0L);
public static final QueryParamSmart ONE = new QueryParamSmart(1L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, QueryParamSmart> values = createValuesMap();
private static final Map<Long, QueryParamSmartEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private QueryParamSmart(long value) {
this.value = value;
}
/**
* Returns a QueryParamSmart with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as QueryParamSmart
*/
public static QueryParamSmart of(long value) {
synchronized (QueryParamSmart.class) {
return values.computeIfAbsent(value, v -> new QueryParamSmart(v));
}
}
public long value() {
return value;
}
public static Optional<QueryParamSmart> fromValue(long value) {
for (QueryParamSmart o: QueryParamSmart.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<QueryParamSmartEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
QueryParamSmart other = (QueryParamSmart) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "QueryParamSmart [value=" + value + "]";
}
// return an array just like an enum
public static QueryParamSmart[] values() {
synchronized (QueryParamSmart.class) {
return values.values().toArray(new QueryParamSmart[] {});
}
}
private static final Map<Long, QueryParamSmart> createValuesMap() {
Map<Long, QueryParamSmart> map = new LinkedHashMap<>();
map.put(0L, ZERO);
map.put(1L, ONE);
return map;
}
private static final Map<Long, QueryParamSmartEnum> createEnumsMap() {
Map<Long, QueryParamSmartEnum> map = new HashMap<>();
map.put(0L, QueryParamSmartEnum.ZERO);
map.put(1L, QueryParamSmartEnum.ONE);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<QueryParamSmart> {
protected _Serializer() {
super(QueryParamSmart.class);
}
@Override
public void serialize(QueryParamSmart value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<QueryParamSmart> {
protected _Deserializer() {
super(QueryParamSmart.class);
}
@Override
public QueryParamSmart deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return QueryParamSmart.of(v);
}
}
public enum QueryParamSmartEnum {
ZERO(0L),
ONE(1L),;
private final long value;
private QueryParamSmartEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* QueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum QueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = QueryParamType._Deserializer.class)
@JsonSerialize(using = QueryParamType._Serializer.class)
public class QueryParamType {
public static final QueryParamType Movie = new QueryParamType(1L);
public static final QueryParamType TvShow = new QueryParamType(2L);
public static final QueryParamType Season = new QueryParamType(3L);
public static final QueryParamType Episode = new QueryParamType(4L);
public static final QueryParamType Audio = new QueryParamType(8L);
public static final QueryParamType Album = new QueryParamType(9L);
public static final QueryParamType Track = new QueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, QueryParamType> values = createValuesMap();
private static final Map<Long, QueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private QueryParamType(long value) {
this.value = value;
}
/**
* Returns a QueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as QueryParamType
*/
public static QueryParamType of(long value) {
synchronized (QueryParamType.class) {
return values.computeIfAbsent(value, v -> new QueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<QueryParamType> fromValue(long value) {
for (QueryParamType o: QueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<QueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
QueryParamType other = (QueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "QueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static QueryParamType[] values() {
synchronized (QueryParamType.class) {
return values.values().toArray(new QueryParamType[] {});
}
}
private static final Map<Long, QueryParamType> createValuesMap() {
Map<Long, QueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, QueryParamTypeEnum> createEnumsMap() {
Map<Long, QueryParamTypeEnum> map = new HashMap<>();
map.put(1L, QueryParamTypeEnum.Movie);
map.put(2L, QueryParamTypeEnum.TvShow);
map.put(3L, QueryParamTypeEnum.Season);
map.put(4L, QueryParamTypeEnum.Episode);
map.put(8L, QueryParamTypeEnum.Audio);
map.put(9L, QueryParamTypeEnum.Album);
map.put(10L, QueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<QueryParamType> {
protected _Serializer() {
super(QueryParamType.class);
}
@Override
public void serialize(QueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<QueryParamType> {
protected _Deserializer() {
super(QueryParamType.class);
}
@Override
public QueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return QueryParamType.of(v);
}
}
public enum QueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private QueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,36 +3,189 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum SearchTypes {
MOVIES("movies"),
MUSIC("music"),
OTHER_VIDEOS("otherVideos"),
PEOPLE("people"),
TV("tv");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = SearchTypes._Deserializer.class)
@JsonSerialize(using = SearchTypes._Serializer.class)
public class SearchTypes {
public static final SearchTypes MOVIES = new SearchTypes("movies");
public static final SearchTypes MUSIC = new SearchTypes("music");
public static final SearchTypes OTHER_VIDEOS = new SearchTypes("otherVideos");
public static final SearchTypes PEOPLE = new SearchTypes("people");
public static final SearchTypes TV = new SearchTypes("tv");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, SearchTypes> values = createValuesMap();
private static final Map<String, SearchTypesEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private SearchTypes(String value) {
this.value = value;
}
/**
* Returns a SearchTypes with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as SearchTypes
*/
public static SearchTypes of(String value) {
synchronized (SearchTypes.class) {
return values.computeIfAbsent(value, v -> new SearchTypes(v));
}
}
public String value() {
return value;
}
public static Optional<SearchTypes> fromValue(String value) {
for (SearchTypes o: SearchTypes.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<SearchTypesEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SearchTypes other = (SearchTypes) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "SearchTypes [value=" + value + "]";
}
// return an array just like an enum
public static SearchTypes[] values() {
synchronized (SearchTypes.class) {
return values.values().toArray(new SearchTypes[] {});
}
}
private static final Map<String, SearchTypes> createValuesMap() {
Map<String, SearchTypes> map = new LinkedHashMap<>();
map.put("movies", MOVIES);
map.put("music", MUSIC);
map.put("otherVideos", OTHER_VIDEOS);
map.put("people", PEOPLE);
map.put("tv", TV);
return map;
}
private static final Map<String, SearchTypesEnum> createEnumsMap() {
Map<String, SearchTypesEnum> map = new HashMap<>();
map.put("movies", SearchTypesEnum.MOVIES);
map.put("music", SearchTypesEnum.MUSIC);
map.put("otherVideos", SearchTypesEnum.OTHER_VIDEOS);
map.put("people", SearchTypesEnum.PEOPLE);
map.put("tv", SearchTypesEnum.TV);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<SearchTypes> {
protected _Serializer() {
super(SearchTypes.class);
}
@Override
public void serialize(SearchTypes value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<SearchTypes> {
protected _Deserializer() {
super(SearchTypes.class);
}
@Override
public SearchTypes deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return SearchTypes.of(v);
}
}
public enum SearchTypesEnum {
MOVIES("movies"),
MUSIC("music"),
OTHER_VIDEOS("otherVideos"),
PEOPLE("people"),
TV("tv"),;
private final String value;
private SearchTypesEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,11 +3,44 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* ShowOrdering
*
@@ -18,31 +51,151 @@ import java.util.Optional;
* dvd = TheTVDB (DVD),
* absolute = TheTVDB (Absolute)).
*/
public enum ShowOrdering {
None("None"),
TmdbAiring("tmdbAiring"),
TvdbAired("aired"),
TvdbDvd("dvd"),
TvdbAbsolute("absolute");
@JsonDeserialize(using = ShowOrdering._Deserializer.class)
@JsonSerialize(using = ShowOrdering._Serializer.class)
public class ShowOrdering {
public static final ShowOrdering None = new ShowOrdering("None");
public static final ShowOrdering TmdbAiring = new ShowOrdering("tmdbAiring");
public static final ShowOrdering TvdbAired = new ShowOrdering("aired");
public static final ShowOrdering TvdbDvd = new ShowOrdering("dvd");
public static final ShowOrdering TvdbAbsolute = new ShowOrdering("absolute");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, ShowOrdering> values = createValuesMap();
private static final Map<String, ShowOrderingEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private ShowOrdering(String value) {
this.value = value;
}
/**
* Returns a ShowOrdering with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as ShowOrdering
*/
public static ShowOrdering of(String value) {
synchronized (ShowOrdering.class) {
return values.computeIfAbsent(value, v -> new ShowOrdering(v));
}
}
public String value() {
return value;
}
public static Optional<ShowOrdering> fromValue(String value) {
for (ShowOrdering o: ShowOrdering.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<ShowOrderingEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ShowOrdering other = (ShowOrdering) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "ShowOrdering [value=" + value + "]";
}
// return an array just like an enum
public static ShowOrdering[] values() {
synchronized (ShowOrdering.class) {
return values.values().toArray(new ShowOrdering[] {});
}
}
private static final Map<String, ShowOrdering> createValuesMap() {
Map<String, ShowOrdering> map = new LinkedHashMap<>();
map.put("None", None);
map.put("tmdbAiring", TmdbAiring);
map.put("aired", TvdbAired);
map.put("dvd", TvdbDvd);
map.put("absolute", TvdbAbsolute);
return map;
}
private static final Map<String, ShowOrderingEnum> createEnumsMap() {
Map<String, ShowOrderingEnum> map = new HashMap<>();
map.put("None", ShowOrderingEnum.None);
map.put("tmdbAiring", ShowOrderingEnum.TmdbAiring);
map.put("aired", ShowOrderingEnum.TvdbAired);
map.put("dvd", ShowOrderingEnum.TvdbDvd);
map.put("absolute", ShowOrderingEnum.TvdbAbsolute);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<ShowOrdering> {
protected _Serializer() {
super(ShowOrdering.class);
}
@Override
public void serialize(ShowOrdering value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<ShowOrdering> {
protected _Deserializer() {
super(ShowOrdering.class);
}
@Override
public ShowOrdering deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return ShowOrdering.of(v);
}
}
public enum ShowOrderingEnum {
None("None"),
TmdbAiring("tmdbAiring"),
TvdbAired("aired"),
TvdbDvd("dvd"),
TvdbAbsolute("absolute"),;
private final String value;
private ShowOrderingEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* State
*
* <p>The state of the media item
*/
public enum State {
PLAYING("playing"),
PAUSED("paused"),
STOPPED("stopped");
@JsonDeserialize(using = State._Deserializer.class)
@JsonSerialize(using = State._Serializer.class)
public class State {
public static final State PLAYING = new State("playing");
public static final State PAUSED = new State("paused");
public static final State STOPPED = new State("stopped");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, State> values = createValuesMap();
private static final Map<String, StateEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private State(String value) {
this.value = value;
}
/**
* Returns a State with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as State
*/
public static State of(String value) {
synchronized (State.class) {
return values.computeIfAbsent(value, v -> new State(v));
}
}
public String value() {
return value;
}
public static Optional<State> fromValue(String value) {
for (State o: State.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<StateEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
State other = (State) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "State [value=" + value + "]";
}
// return an array just like an enum
public static State[] values() {
synchronized (State.class) {
return values.values().toArray(new State[] {});
}
}
private static final Map<String, State> createValuesMap() {
Map<String, State> map = new LinkedHashMap<>();
map.put("playing", PLAYING);
map.put("paused", PAUSED);
map.put("stopped", STOPPED);
return map;
}
private static final Map<String, StateEnum> createEnumsMap() {
Map<String, StateEnum> map = new HashMap<>();
map.put("playing", StateEnum.PLAYING);
map.put("paused", StateEnum.PAUSED);
map.put("stopped", StateEnum.STOPPED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<State> {
protected _Serializer() {
super(State.class);
}
@Override
public void serialize(State value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<State> {
protected _Deserializer() {
super(State.class);
}
@Override
public State deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return State.of(v);
}
}
public enum StateEnum {
PLAYING("playing"),
PAUSED("paused"),
STOPPED("stopped"),;
private final String value;
private StateEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,37 +3,178 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Status
*
* <p>Current friend request status
*/
public enum Status {
ACCEPTED("accepted");
@JsonDeserialize(using = Status._Deserializer.class)
@JsonSerialize(using = Status._Serializer.class)
public class Status {
public static final Status ACCEPTED = new Status("accepted");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, Status> values = createValuesMap();
private static final Map<String, StatusEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private Status(String value) {
this.value = value;
}
/**
* Returns a Status with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Status
*/
public static Status of(String value) {
synchronized (Status.class) {
return values.computeIfAbsent(value, v -> new Status(v));
}
}
public String value() {
return value;
}
public static Optional<Status> fromValue(String value) {
for (Status o: Status.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<StatusEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Status other = (Status) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Status [value=" + value + "]";
}
// return an array just like an enum
public static Status[] values() {
synchronized (Status.class) {
return values.values().toArray(new Status[] {});
}
}
private static final Map<String, Status> createValuesMap() {
Map<String, Status> map = new LinkedHashMap<>();
map.put("accepted", ACCEPTED);
return map;
}
private static final Map<String, StatusEnum> createEnumsMap() {
Map<String, StatusEnum> map = new HashMap<>();
map.put("accepted", StatusEnum.ACCEPTED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Status> {
protected _Serializer() {
super(Status.class);
}
@Override
public void serialize(Status value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Status> {
protected _Deserializer() {
super(Status.class);
}
@Override
public Status deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return Status.of(v);
}
}
public enum StatusEnum {
ACCEPTED("accepted"),;
private final String value;
private StatusEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,52 +3,238 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Tag
*
* <p>A key representing a specific tag within the section.
*/
public enum Tag {
UNWATCHED("unwatched"),
NEWEST("newest"),
RECENTLY_ADDED("recentlyAdded"),
RECENTLY_VIEWED("recentlyViewed"),
ON_DECK("onDeck"),
COLLECTION("collection"),
EDITION("edition"),
YEAR("year"),
DECADE("decade"),
DIRECTOR("director"),
CONTENT_RATING("contentRating"),
RATING("rating"),
RESOLUTION("resolution"),
FIRST_CHARACTER("firstCharacter"),
FOLDER("folder"),
ALBUMS("albums");
@JsonDeserialize(using = Tag._Deserializer.class)
@JsonSerialize(using = Tag._Serializer.class)
public class Tag {
public static final Tag UNWATCHED = new Tag("unwatched");
public static final Tag NEWEST = new Tag("newest");
public static final Tag RECENTLY_ADDED = new Tag("recentlyAdded");
public static final Tag RECENTLY_VIEWED = new Tag("recentlyViewed");
public static final Tag ON_DECK = new Tag("onDeck");
public static final Tag COLLECTION = new Tag("collection");
public static final Tag EDITION = new Tag("edition");
public static final Tag YEAR = new Tag("year");
public static final Tag DECADE = new Tag("decade");
public static final Tag DIRECTOR = new Tag("director");
public static final Tag CONTENT_RATING = new Tag("contentRating");
public static final Tag RATING = new Tag("rating");
public static final Tag RESOLUTION = new Tag("resolution");
public static final Tag FIRST_CHARACTER = new Tag("firstCharacter");
public static final Tag FOLDER = new Tag("folder");
public static final Tag ALBUMS = new Tag("albums");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, Tag> values = createValuesMap();
private static final Map<String, TagEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private Tag(String value) {
this.value = value;
}
/**
* Returns a Tag with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Tag
*/
public static Tag of(String value) {
synchronized (Tag.class) {
return values.computeIfAbsent(value, v -> new Tag(v));
}
}
public String value() {
return value;
}
public static Optional<Tag> fromValue(String value) {
for (Tag o: Tag.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<TagEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tag other = (Tag) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Tag [value=" + value + "]";
}
// return an array just like an enum
public static Tag[] values() {
synchronized (Tag.class) {
return values.values().toArray(new Tag[] {});
}
}
private static final Map<String, Tag> createValuesMap() {
Map<String, Tag> map = new LinkedHashMap<>();
map.put("unwatched", UNWATCHED);
map.put("newest", NEWEST);
map.put("recentlyAdded", RECENTLY_ADDED);
map.put("recentlyViewed", RECENTLY_VIEWED);
map.put("onDeck", ON_DECK);
map.put("collection", COLLECTION);
map.put("edition", EDITION);
map.put("year", YEAR);
map.put("decade", DECADE);
map.put("director", DIRECTOR);
map.put("contentRating", CONTENT_RATING);
map.put("rating", RATING);
map.put("resolution", RESOLUTION);
map.put("firstCharacter", FIRST_CHARACTER);
map.put("folder", FOLDER);
map.put("albums", ALBUMS);
return map;
}
private static final Map<String, TagEnum> createEnumsMap() {
Map<String, TagEnum> map = new HashMap<>();
map.put("unwatched", TagEnum.UNWATCHED);
map.put("newest", TagEnum.NEWEST);
map.put("recentlyAdded", TagEnum.RECENTLY_ADDED);
map.put("recentlyViewed", TagEnum.RECENTLY_VIEWED);
map.put("onDeck", TagEnum.ON_DECK);
map.put("collection", TagEnum.COLLECTION);
map.put("edition", TagEnum.EDITION);
map.put("year", TagEnum.YEAR);
map.put("decade", TagEnum.DECADE);
map.put("director", TagEnum.DIRECTOR);
map.put("contentRating", TagEnum.CONTENT_RATING);
map.put("rating", TagEnum.RATING);
map.put("resolution", TagEnum.RESOLUTION);
map.put("firstCharacter", TagEnum.FIRST_CHARACTER);
map.put("folder", TagEnum.FOLDER);
map.put("albums", TagEnum.ALBUMS);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Tag> {
protected _Serializer() {
super(Tag.class);
}
@Override
public void serialize(Tag value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Tag> {
protected _Deserializer() {
super(Tag.class);
}
@Override
public Tag deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return Tag.of(v);
}
}
public enum TagEnum {
UNWATCHED("unwatched"),
NEWEST("newest"),
RECENTLY_ADDED("recentlyAdded"),
RECENTLY_VIEWED("recentlyViewed"),
ON_DECK("onDeck"),
COLLECTION("collection"),
EDITION("edition"),
YEAR("year"),
DECADE("decade"),
DIRECTOR("director"),
CONTENT_RATING("contentRating"),
RATING("rating"),
RESOLUTION("resolution"),
FIRST_CHARACTER("firstCharacter"),
FOLDER("folder"),
ALBUMS("albums"),;
private final String value;
private TagEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,50 +3,230 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* TaskName
*
* <p>the name of the task to be started.
*/
public enum TaskName {
BACKUP_DATABASE("BackupDatabase"),
BUILD_GRACENOTE_COLLECTIONS("BuildGracenoteCollections"),
CHECK_FOR_UPDATES("CheckForUpdates"),
CLEAN_OLD_BUNDLES("CleanOldBundles"),
CLEAN_OLD_CACHE_FILES("CleanOldCacheFiles"),
DEEP_MEDIA_ANALYSIS("DeepMediaAnalysis"),
GENERATE_AUTO_TAGS("GenerateAutoTags"),
GENERATE_CHAPTER_THUMBS("GenerateChapterThumbs"),
GENERATE_MEDIA_INDEX_FILES("GenerateMediaIndexFiles"),
OPTIMIZE_DATABASE("OptimizeDatabase"),
REFRESH_LIBRARIES("RefreshLibraries"),
REFRESH_LOCAL_MEDIA("RefreshLocalMedia"),
REFRESH_PERIODIC_METADATA("RefreshPeriodicMetadata"),
UPGRADE_MEDIA_ANALYSIS("UpgradeMediaAnalysis");
@JsonDeserialize(using = TaskName._Deserializer.class)
@JsonSerialize(using = TaskName._Serializer.class)
public class TaskName {
public static final TaskName BACKUP_DATABASE = new TaskName("BackupDatabase");
public static final TaskName BUILD_GRACENOTE_COLLECTIONS = new TaskName("BuildGracenoteCollections");
public static final TaskName CHECK_FOR_UPDATES = new TaskName("CheckForUpdates");
public static final TaskName CLEAN_OLD_BUNDLES = new TaskName("CleanOldBundles");
public static final TaskName CLEAN_OLD_CACHE_FILES = new TaskName("CleanOldCacheFiles");
public static final TaskName DEEP_MEDIA_ANALYSIS = new TaskName("DeepMediaAnalysis");
public static final TaskName GENERATE_AUTO_TAGS = new TaskName("GenerateAutoTags");
public static final TaskName GENERATE_CHAPTER_THUMBS = new TaskName("GenerateChapterThumbs");
public static final TaskName GENERATE_MEDIA_INDEX_FILES = new TaskName("GenerateMediaIndexFiles");
public static final TaskName OPTIMIZE_DATABASE = new TaskName("OptimizeDatabase");
public static final TaskName REFRESH_LIBRARIES = new TaskName("RefreshLibraries");
public static final TaskName REFRESH_LOCAL_MEDIA = new TaskName("RefreshLocalMedia");
public static final TaskName REFRESH_PERIODIC_METADATA = new TaskName("RefreshPeriodicMetadata");
public static final TaskName UPGRADE_MEDIA_ANALYSIS = new TaskName("UpgradeMediaAnalysis");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, TaskName> values = createValuesMap();
private static final Map<String, TaskNameEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private TaskName(String value) {
this.value = value;
}
/**
* Returns a TaskName with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as TaskName
*/
public static TaskName of(String value) {
synchronized (TaskName.class) {
return values.computeIfAbsent(value, v -> new TaskName(v));
}
}
public String value() {
return value;
}
public static Optional<TaskName> fromValue(String value) {
for (TaskName o: TaskName.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<TaskNameEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TaskName other = (TaskName) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "TaskName [value=" + value + "]";
}
// return an array just like an enum
public static TaskName[] values() {
synchronized (TaskName.class) {
return values.values().toArray(new TaskName[] {});
}
}
private static final Map<String, TaskName> createValuesMap() {
Map<String, TaskName> map = new LinkedHashMap<>();
map.put("BackupDatabase", BACKUP_DATABASE);
map.put("BuildGracenoteCollections", BUILD_GRACENOTE_COLLECTIONS);
map.put("CheckForUpdates", CHECK_FOR_UPDATES);
map.put("CleanOldBundles", CLEAN_OLD_BUNDLES);
map.put("CleanOldCacheFiles", CLEAN_OLD_CACHE_FILES);
map.put("DeepMediaAnalysis", DEEP_MEDIA_ANALYSIS);
map.put("GenerateAutoTags", GENERATE_AUTO_TAGS);
map.put("GenerateChapterThumbs", GENERATE_CHAPTER_THUMBS);
map.put("GenerateMediaIndexFiles", GENERATE_MEDIA_INDEX_FILES);
map.put("OptimizeDatabase", OPTIMIZE_DATABASE);
map.put("RefreshLibraries", REFRESH_LIBRARIES);
map.put("RefreshLocalMedia", REFRESH_LOCAL_MEDIA);
map.put("RefreshPeriodicMetadata", REFRESH_PERIODIC_METADATA);
map.put("UpgradeMediaAnalysis", UPGRADE_MEDIA_ANALYSIS);
return map;
}
private static final Map<String, TaskNameEnum> createEnumsMap() {
Map<String, TaskNameEnum> map = new HashMap<>();
map.put("BackupDatabase", TaskNameEnum.BACKUP_DATABASE);
map.put("BuildGracenoteCollections", TaskNameEnum.BUILD_GRACENOTE_COLLECTIONS);
map.put("CheckForUpdates", TaskNameEnum.CHECK_FOR_UPDATES);
map.put("CleanOldBundles", TaskNameEnum.CLEAN_OLD_BUNDLES);
map.put("CleanOldCacheFiles", TaskNameEnum.CLEAN_OLD_CACHE_FILES);
map.put("DeepMediaAnalysis", TaskNameEnum.DEEP_MEDIA_ANALYSIS);
map.put("GenerateAutoTags", TaskNameEnum.GENERATE_AUTO_TAGS);
map.put("GenerateChapterThumbs", TaskNameEnum.GENERATE_CHAPTER_THUMBS);
map.put("GenerateMediaIndexFiles", TaskNameEnum.GENERATE_MEDIA_INDEX_FILES);
map.put("OptimizeDatabase", TaskNameEnum.OPTIMIZE_DATABASE);
map.put("RefreshLibraries", TaskNameEnum.REFRESH_LIBRARIES);
map.put("RefreshLocalMedia", TaskNameEnum.REFRESH_LOCAL_MEDIA);
map.put("RefreshPeriodicMetadata", TaskNameEnum.REFRESH_PERIODIC_METADATA);
map.put("UpgradeMediaAnalysis", TaskNameEnum.UPGRADE_MEDIA_ANALYSIS);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<TaskName> {
protected _Serializer() {
super(TaskName.class);
}
@Override
public void serialize(TaskName value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<TaskName> {
protected _Deserializer() {
super(TaskName.class);
}
@Override
public TaskName deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return TaskName.of(v);
}
}
public enum TaskNameEnum {
BACKUP_DATABASE("BackupDatabase"),
BUILD_GRACENOTE_COLLECTIONS("BuildGracenoteCollections"),
CHECK_FOR_UPDATES("CheckForUpdates"),
CLEAN_OLD_BUNDLES("CleanOldBundles"),
CLEAN_OLD_CACHE_FILES("CleanOldCacheFiles"),
DEEP_MEDIA_ANALYSIS("DeepMediaAnalysis"),
GENERATE_AUTO_TAGS("GenerateAutoTags"),
GENERATE_CHAPTER_THUMBS("GenerateChapterThumbs"),
GENERATE_MEDIA_INDEX_FILES("GenerateMediaIndexFiles"),
OPTIMIZE_DATABASE("OptimizeDatabase"),
REFRESH_LIBRARIES("RefreshLibraries"),
REFRESH_LOCAL_MEDIA("RefreshLocalMedia"),
REFRESH_PERIODIC_METADATA("RefreshPeriodicMetadata"),
UPGRADE_MEDIA_ANALYSIS("UpgradeMediaAnalysis"),;
private final String value;
private TaskNameEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Type
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum Type {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = Type._Deserializer.class)
@JsonSerialize(using = Type._Serializer.class)
public class Type {
public static final Type Movie = new Type(1L);
public static final Type TvShow = new Type(2L);
public static final Type Season = new Type(3L);
public static final Type Episode = new Type(4L);
public static final Type Audio = new Type(8L);
public static final Type Album = new Type(9L);
public static final Type Track = new Type(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, Type> values = createValuesMap();
private static final Map<Long, TypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private Type(long value) {
this.value = value;
}
/**
* Returns a Type with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Type
*/
public static Type of(long value) {
synchronized (Type.class) {
return values.computeIfAbsent(value, v -> new Type(v));
}
}
public long value() {
return value;
}
public static Optional<Type> fromValue(long value) {
for (Type o: Type.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<TypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Type other = (Type) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Type [value=" + value + "]";
}
// return an array just like an enum
public static Type[] values() {
synchronized (Type.class) {
return values.values().toArray(new Type[] {});
}
}
private static final Map<Long, Type> createValuesMap() {
Map<Long, Type> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, TypeEnum> createEnumsMap() {
Map<Long, TypeEnum> map = new HashMap<>();
map.put(1L, TypeEnum.Movie);
map.put(2L, TypeEnum.TvShow);
map.put(3L, TypeEnum.Season);
map.put(4L, TypeEnum.Episode);
map.put(8L, TypeEnum.Audio);
map.put(9L, TypeEnum.Album);
map.put(10L, TypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Type> {
protected _Serializer() {
super(Type.class);
}
@Override
public void serialize(Type value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Type> {
protected _Deserializer() {
super(Type.class);
}
@Override
public Type deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return Type.of(v);
}
}
public enum TypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private TypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -17,20 +17,20 @@ import java.util.Objects;
public class UploadPlaylistRequest {
/**
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
*/
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=path")
private String path;
/**
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
*/
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")
@@ -56,11 +56,11 @@ public class UploadPlaylistRequest {
}
/**
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
*/
@JsonIgnore
@@ -69,9 +69,9 @@ public class UploadPlaylistRequest {
}
/**
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
*/
@JsonIgnore
@@ -92,11 +92,11 @@ public class UploadPlaylistRequest {
}
/**
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
*/
public UploadPlaylistRequest withPath(String path) {
@@ -106,9 +106,9 @@ public class UploadPlaylistRequest {
}
/**
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
*/
public UploadPlaylistRequest withForce(QueryParamForce force) {
@@ -171,11 +171,11 @@ public class UploadPlaylistRequest {
}
/**
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
* If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
* Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
* If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
* The GUID of each playlist is based on the filename.
*/
public Builder path(String path) {
@@ -185,9 +185,9 @@ public class UploadPlaylistRequest {
}
/**
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* Force overwriting of duplicate playlists.
* By default, a playlist file uploaded with the same path will overwrite the existing playlist.
* The `force` argument is used to disable overwriting.
* If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
*/
public Builder force(QueryParamForce force) {