ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.541.2

This commit is contained in:
speakeasybot
2025-05-01 00:34:27 +00:00
parent 0077561a6a
commit c0e915da8b
56 changed files with 5644 additions and 2989 deletions

View File

@@ -52,7 +52,7 @@ public class PlexAPI {
/**
* The full address of your Plex Server
*/
"https://10.10.10.47:32400",
"{protocol}://{ip}:{port}",
};
/**

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.16.0";
public static final String GEN_VERSION = "2.585.2";
public static final String SDK_VERSION = "0.16.1";
public static final String GEN_VERSION = "2.595.4";
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

@@ -0,0 +1,172 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* Attributes
*
* <p>Attributes associated with the marker.
*/
public class Attributes {
/**
* The identifier for the attributes.
*/
@JsonProperty("id")
private long id;
/**
* The version number of the marker attributes.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("version")
private Optional<Long> version;
@JsonCreator
public Attributes(
@JsonProperty("id") long id,
@JsonProperty("version") Optional<Long> version) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(version, "version");
this.id = id;
this.version = version;
}
public Attributes(
long id) {
this(id, Optional.empty());
}
/**
* The identifier for the attributes.
*/
@JsonIgnore
public long id() {
return id;
}
/**
* The version number of the marker attributes.
*/
@JsonIgnore
public Optional<Long> version() {
return version;
}
public final static Builder builder() {
return new Builder();
}
/**
* The identifier for the attributes.
*/
public Attributes withId(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The version number of the marker attributes.
*/
public Attributes withVersion(long version) {
Utils.checkNotNull(version, "version");
this.version = Optional.ofNullable(version);
return this;
}
/**
* The version number of the marker attributes.
*/
public Attributes withVersion(Optional<Long> version) {
Utils.checkNotNull(version, "version");
this.version = version;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Attributes other = (Attributes) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.version, other.version);
}
@Override
public int hashCode() {
return Objects.hash(
id,
version);
}
@Override
public String toString() {
return Utils.toString(Attributes.class,
"id", id,
"version", version);
}
public final static class Builder {
private Long id;
private Optional<Long> version = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* The identifier for the attributes.
*/
public Builder id(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The version number of the marker attributes.
*/
public Builder version(long version) {
Utils.checkNotNull(version, "version");
this.version = Optional.ofNullable(version);
return this;
}
/**
* The version number of the marker attributes.
*/
public Builder version(Optional<Long> version) {
Utils.checkNotNull(version, "version");
this.version = version;
return this;
}
public Attributes build() {
return new Attributes(
id,
version);
}
}
}

View File

@@ -0,0 +1,237 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
/**
* Chapter
*
* <p>The thumbnail for the chapter
*/
public class Chapter {
@JsonProperty("id")
private long id;
@JsonProperty("filter")
private String filter;
@JsonProperty("index")
private long index;
@JsonProperty("startTimeOffset")
private long startTimeOffset;
@JsonProperty("endTimeOffset")
private long endTimeOffset;
@JsonProperty("thumb")
private String thumb;
@JsonCreator
public Chapter(
@JsonProperty("id") long id,
@JsonProperty("filter") String filter,
@JsonProperty("index") long index,
@JsonProperty("startTimeOffset") long startTimeOffset,
@JsonProperty("endTimeOffset") long endTimeOffset,
@JsonProperty("thumb") String thumb) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(index, "index");
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
Utils.checkNotNull(thumb, "thumb");
this.id = id;
this.filter = filter;
this.index = index;
this.startTimeOffset = startTimeOffset;
this.endTimeOffset = endTimeOffset;
this.thumb = thumb;
}
@JsonIgnore
public long id() {
return id;
}
@JsonIgnore
public String filter() {
return filter;
}
@JsonIgnore
public long index() {
return index;
}
@JsonIgnore
public long startTimeOffset() {
return startTimeOffset;
}
@JsonIgnore
public long endTimeOffset() {
return endTimeOffset;
}
@JsonIgnore
public String thumb() {
return thumb;
}
public final static Builder builder() {
return new Builder();
}
public Chapter withId(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public Chapter withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
public Chapter withIndex(long index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
}
public Chapter withStartTimeOffset(long startTimeOffset) {
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
this.startTimeOffset = startTimeOffset;
return this;
}
public Chapter withEndTimeOffset(long endTimeOffset) {
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
this.endTimeOffset = endTimeOffset;
return this;
}
public Chapter withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Chapter other = (Chapter) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.index, other.index) &&
Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) &&
Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) &&
Objects.deepEquals(this.thumb, other.thumb);
}
@Override
public int hashCode() {
return Objects.hash(
id,
filter,
index,
startTimeOffset,
endTimeOffset,
thumb);
}
@Override
public String toString() {
return Utils.toString(Chapter.class,
"id", id,
"filter", filter,
"index", index,
"startTimeOffset", startTimeOffset,
"endTimeOffset", endTimeOffset,
"thumb", thumb);
}
public final static class Builder {
private Long id;
private String filter;
private Long index;
private Long startTimeOffset;
private Long endTimeOffset;
private String thumb;
private Builder() {
// force use of static builder() method
}
public Builder id(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
public Builder index(long index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
}
public Builder startTimeOffset(long startTimeOffset) {
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
this.startTimeOffset = startTimeOffset;
return this;
}
public Builder endTimeOffset(long endTimeOffset) {
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
this.endTimeOffset = endTimeOffset;
return this;
}
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
public Chapter build() {
return new Chapter(
id,
filter,
index,
startTimeOffset,
endTimeOffset,
thumb);
}
}
}

View File

@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
@@ -23,7 +23,7 @@ import java.util.Optional;
public class Country {
@JsonProperty("id")
private long id;
private int id;
/**
* The country of origin of this media item
@@ -37,7 +37,7 @@ public class Country {
@JsonCreator
public Country(
@JsonProperty("id") long id,
@JsonProperty("id") int id,
@JsonProperty("tag") String tag,
@JsonProperty("filter") Optional<String> filter) {
Utils.checkNotNull(id, "id");
@@ -49,13 +49,13 @@ public class Country {
}
public Country(
long id,
int id,
String tag) {
this(id, tag, Optional.empty());
}
@JsonIgnore
public long id() {
public int id() {
return id;
}
@@ -76,7 +76,7 @@ public class Country {
return new Builder();
}
public Country withId(long id) {
public Country withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
@@ -137,7 +137,7 @@ public class Country {
public final static class Builder {
private Long id;
private Integer id;
private String tag;
@@ -147,7 +147,7 @@ public class Country {
// force use of static builder() method
}
public Builder id(long id) {
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;

View File

@@ -0,0 +1,125 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class Extras {
/**
* The size of the extras.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("size")
private Optional<Long> size;
@JsonCreator
public Extras(
@JsonProperty("size") Optional<Long> size) {
Utils.checkNotNull(size, "size");
this.size = size;
}
public Extras() {
this(Optional.empty());
}
/**
* The size of the extras.
*/
@JsonIgnore
public Optional<Long> size() {
return size;
}
public final static Builder builder() {
return new Builder();
}
/**
* The size of the extras.
*/
public Extras withSize(long size) {
Utils.checkNotNull(size, "size");
this.size = Optional.ofNullable(size);
return this;
}
/**
* The size of the extras.
*/
public Extras withSize(Optional<Long> size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Extras other = (Extras) o;
return
Objects.deepEquals(this.size, other.size);
}
@Override
public int hashCode() {
return Objects.hash(
size);
}
@Override
public String toString() {
return Utils.toString(Extras.class,
"size", size);
}
public final static class Builder {
private Optional<Long> size = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* The size of the extras.
*/
public Builder size(long size) {
Utils.checkNotNull(size, "size");
this.size = Optional.ofNullable(size);
return this;
}
/**
* The size of the extras.
*/
public Builder size(Optional<Long> size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
public Extras build() {
return new Extras(
size);
}
}
}

View File

@@ -27,10 +27,20 @@ public class GetAllMediaLibraryStream {
private long id;
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonProperty("streamType")
private int streamType;
private GetAllMediaLibraryStreamType streamType;
/**
* Format of the stream (e.g., srt).
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("format")
private Optional<String> format;
/**
* Indicates if this stream is default.
@@ -48,8 +58,9 @@ public class GetAllMediaLibraryStream {
/**
* Index of the stream.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("index")
private int index;
private Optional<Integer> index;
/**
* Bitrate of the stream.
@@ -216,6 +227,13 @@ public class GetAllMediaLibraryStream {
@JsonProperty("frameRate")
private Optional<Float> frameRate;
/**
* Key to access this stream part.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("key")
private Optional<String> key;
/**
* Height of the video stream.
*/
@@ -345,10 +363,11 @@ public class GetAllMediaLibraryStream {
@JsonCreator
public GetAllMediaLibraryStream(
@JsonProperty("id") long id,
@JsonProperty("streamType") int streamType,
@JsonProperty("streamType") GetAllMediaLibraryStreamType streamType,
@JsonProperty("format") Optional<String> format,
@JsonProperty("default") Optional<Boolean> default_,
@JsonProperty("codec") String codec,
@JsonProperty("index") int index,
@JsonProperty("index") Optional<Integer> index,
@JsonProperty("bitrate") Optional<Integer> bitrate,
@JsonProperty("language") Optional<String> language,
@JsonProperty("languageTag") Optional<String> languageTag,
@@ -373,6 +392,7 @@ public class GetAllMediaLibraryStream {
@JsonProperty("colorSpace") Optional<String> colorSpace,
@JsonProperty("colorTrc") Optional<String> colorTrc,
@JsonProperty("frameRate") Optional<Float> frameRate,
@JsonProperty("key") Optional<String> key,
@JsonProperty("height") Optional<Integer> height,
@JsonProperty("level") Optional<Integer> level,
@JsonProperty("original") Optional<Boolean> original,
@@ -395,6 +415,7 @@ public class GetAllMediaLibraryStream {
@JsonProperty("title") Optional<String> title) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(streamType, "streamType");
Utils.checkNotNull(format, "format");
Utils.checkNotNull(default_, "default_");
Utils.checkNotNull(codec, "codec");
Utils.checkNotNull(index, "index");
@@ -422,6 +443,7 @@ public class GetAllMediaLibraryStream {
Utils.checkNotNull(colorSpace, "colorSpace");
Utils.checkNotNull(colorTrc, "colorTrc");
Utils.checkNotNull(frameRate, "frameRate");
Utils.checkNotNull(key, "key");
Utils.checkNotNull(height, "height");
Utils.checkNotNull(level, "level");
Utils.checkNotNull(original, "original");
@@ -444,6 +466,7 @@ public class GetAllMediaLibraryStream {
Utils.checkNotNull(title, "title");
this.id = id;
this.streamType = streamType;
this.format = format;
this.default_ = default_;
this.codec = codec;
this.index = index;
@@ -471,6 +494,7 @@ public class GetAllMediaLibraryStream {
this.colorSpace = colorSpace;
this.colorTrc = colorTrc;
this.frameRate = frameRate;
this.key = key;
this.height = height;
this.level = level;
this.original = original;
@@ -495,12 +519,11 @@ public class GetAllMediaLibraryStream {
public GetAllMediaLibraryStream(
long id,
int streamType,
GetAllMediaLibraryStreamType streamType,
String codec,
int index,
String displayTitle,
String extendedDisplayTitle) {
this(id, streamType, Optional.empty(), codec, index, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
this(id, streamType, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -512,13 +535,24 @@ public class GetAllMediaLibraryStream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonIgnore
public int streamType() {
public GetAllMediaLibraryStreamType streamType() {
return streamType;
}
/**
* Format of the stream (e.g., srt).
*/
@JsonIgnore
public Optional<String> format() {
return format;
}
/**
* Indicates if this stream is default.
*/
@@ -539,7 +573,7 @@ public class GetAllMediaLibraryStream {
* Index of the stream.
*/
@JsonIgnore
public int index() {
public Optional<Integer> index() {
return index;
}
@@ -732,6 +766,14 @@ public class GetAllMediaLibraryStream {
return frameRate;
}
/**
* Key to access this stream part.
*/
@JsonIgnore
public Optional<String> key() {
return key;
}
/**
* Height of the video stream.
*/
@@ -894,14 +936,35 @@ public class GetAllMediaLibraryStream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
public GetAllMediaLibraryStream withStreamType(int streamType) {
public GetAllMediaLibraryStream withStreamType(GetAllMediaLibraryStreamType streamType) {
Utils.checkNotNull(streamType, "streamType");
this.streamType = streamType;
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public GetAllMediaLibraryStream withFormat(String format) {
Utils.checkNotNull(format, "format");
this.format = Optional.ofNullable(format);
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public GetAllMediaLibraryStream withFormat(Optional<String> format) {
Utils.checkNotNull(format, "format");
this.format = format;
return this;
}
/**
* Indicates if this stream is default.
*/
@@ -933,6 +996,15 @@ public class GetAllMediaLibraryStream {
* Index of the stream.
*/
public GetAllMediaLibraryStream withIndex(int index) {
Utils.checkNotNull(index, "index");
this.index = Optional.ofNullable(index);
return this;
}
/**
* Index of the stream.
*/
public GetAllMediaLibraryStream withIndex(Optional<Integer> index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
@@ -1364,6 +1436,24 @@ public class GetAllMediaLibraryStream {
return this;
}
/**
* Key to access this stream part.
*/
public GetAllMediaLibraryStream withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = Optional.ofNullable(key);
return this;
}
/**
* Key to access this stream part.
*/
public GetAllMediaLibraryStream withKey(Optional<String> key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* Height of the video stream.
*/
@@ -1695,6 +1785,7 @@ public class GetAllMediaLibraryStream {
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.streamType, other.streamType) &&
Objects.deepEquals(this.format, other.format) &&
Objects.deepEquals(this.default_, other.default_) &&
Objects.deepEquals(this.codec, other.codec) &&
Objects.deepEquals(this.index, other.index) &&
@@ -1722,6 +1813,7 @@ public class GetAllMediaLibraryStream {
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
Objects.deepEquals(this.frameRate, other.frameRate) &&
Objects.deepEquals(this.key, other.key) &&
Objects.deepEquals(this.height, other.height) &&
Objects.deepEquals(this.level, other.level) &&
Objects.deepEquals(this.original, other.original) &&
@@ -1749,6 +1841,7 @@ public class GetAllMediaLibraryStream {
return Objects.hash(
id,
streamType,
format,
default_,
codec,
index,
@@ -1776,6 +1869,7 @@ public class GetAllMediaLibraryStream {
colorSpace,
colorTrc,
frameRate,
key,
height,
level,
original,
@@ -1803,6 +1897,7 @@ public class GetAllMediaLibraryStream {
return Utils.toString(GetAllMediaLibraryStream.class,
"id", id,
"streamType", streamType,
"format", format,
"default_", default_,
"codec", codec,
"index", index,
@@ -1830,6 +1925,7 @@ public class GetAllMediaLibraryStream {
"colorSpace", colorSpace,
"colorTrc", colorTrc,
"frameRate", frameRate,
"key", key,
"height", height,
"level", level,
"original", original,
@@ -1856,13 +1952,15 @@ public class GetAllMediaLibraryStream {
private Long id;
private Integer streamType;
private GetAllMediaLibraryStreamType streamType;
private Optional<String> format = Optional.empty();
private Optional<Boolean> default_ = Optional.empty();
private String codec;
private Integer index;
private Optional<Integer> index = Optional.empty();
private Optional<Integer> bitrate = Optional.empty();
@@ -1912,6 +2010,8 @@ public class GetAllMediaLibraryStream {
private Optional<Float> frameRate = Optional.empty();
private Optional<String> key = Optional.empty();
private Optional<Integer> height = Optional.empty();
private Optional<Integer> level = Optional.empty();
@@ -1966,14 +2066,35 @@ public class GetAllMediaLibraryStream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
public Builder streamType(int streamType) {
public Builder streamType(GetAllMediaLibraryStreamType streamType) {
Utils.checkNotNull(streamType, "streamType");
this.streamType = streamType;
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Builder format(String format) {
Utils.checkNotNull(format, "format");
this.format = Optional.ofNullable(format);
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Builder format(Optional<String> format) {
Utils.checkNotNull(format, "format");
this.format = format;
return this;
}
/**
* Indicates if this stream is default.
*/
@@ -2005,6 +2126,15 @@ public class GetAllMediaLibraryStream {
* Index of the stream.
*/
public Builder index(int index) {
Utils.checkNotNull(index, "index");
this.index = Optional.ofNullable(index);
return this;
}
/**
* Index of the stream.
*/
public Builder index(Optional<Integer> index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
@@ -2436,6 +2566,24 @@ public class GetAllMediaLibraryStream {
return this;
}
/**
* Key to access this stream part.
*/
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = Optional.ofNullable(key);
return this;
}
/**
* Key to access this stream part.
*/
public Builder key(Optional<String> key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* Height of the video stream.
*/
@@ -2758,6 +2906,7 @@ public class GetAllMediaLibraryStream {
return new GetAllMediaLibraryStream(
id,
streamType,
format,
default_,
codec,
index,
@@ -2785,6 +2934,7 @@ public class GetAllMediaLibraryStream {
colorSpace,
colorTrc,
frameRate,
key,
height,
level,
original,

View File

@@ -0,0 +1,192 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
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.Integer;
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).
*
*/
/**
* GetAllMediaLibraryStreamType
*
* <p>Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonDeserialize(using = GetAllMediaLibraryStreamType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryStreamType._Serializer.class)
public class GetAllMediaLibraryStreamType {
public static final GetAllMediaLibraryStreamType Video = new GetAllMediaLibraryStreamType(1);
public static final GetAllMediaLibraryStreamType Audio = new GetAllMediaLibraryStreamType(2);
public static final GetAllMediaLibraryStreamType Subtitle = new GetAllMediaLibraryStreamType(3);
// 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<Integer, GetAllMediaLibraryStreamType> values = createValuesMap();
private static final Map<Integer, GetAllMediaLibraryStreamTypeEnum> enums = createEnumsMap();
private final int value;
private GetAllMediaLibraryStreamType(int value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryStreamType 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 GetAllMediaLibraryStreamType
*/
public static GetAllMediaLibraryStreamType of(int value) {
synchronized (GetAllMediaLibraryStreamType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryStreamType(v));
}
}
public int value() {
return value;
}
public Optional<GetAllMediaLibraryStreamTypeEnum> 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;
GetAllMediaLibraryStreamType other = (GetAllMediaLibraryStreamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryStreamType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryStreamType[] values() {
synchronized (GetAllMediaLibraryStreamType.class) {
return values.values().toArray(new GetAllMediaLibraryStreamType[] {});
}
}
private static final Map<Integer, GetAllMediaLibraryStreamType> createValuesMap() {
Map<Integer, GetAllMediaLibraryStreamType> map = new LinkedHashMap<>();
map.put(1, Video);
map.put(2, Audio);
map.put(3, Subtitle);
return map;
}
private static final Map<Integer, GetAllMediaLibraryStreamTypeEnum> createEnumsMap() {
Map<Integer, GetAllMediaLibraryStreamTypeEnum> map = new HashMap<>();
map.put(1, GetAllMediaLibraryStreamTypeEnum.Video);
map.put(2, GetAllMediaLibraryStreamTypeEnum.Audio);
map.put(3, GetAllMediaLibraryStreamTypeEnum.Subtitle);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryStreamType> {
protected _Serializer() {
super(GetAllMediaLibraryStreamType.class);
}
@Override
public void serialize(GetAllMediaLibraryStreamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryStreamType> {
protected _Deserializer() {
super(GetAllMediaLibraryStreamType.class);
}
@Override
public GetAllMediaLibraryStreamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
int v = p.readValueAs(new TypeReference<Integer>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryStreamType.of(v);
}
}
public enum GetAllMediaLibraryStreamTypeEnum {
Video(1),
Audio(2),
Subtitle(3),;
private final int value;
private GetAllMediaLibraryStreamTypeEnum(int value) {
this.value = value;
}
public int value() {
return value;
}
}
}

View File

@@ -5,77 +5,77 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* GetMediaMetaDataCountry
*
* <p>The filter query string for country media items.
*/
public class GetMediaMetaDataCountry {
/**
* The unique country identifier.
*/
@JsonProperty("id")
private int id;
/**
* The filter string for the country.
*/
@JsonProperty("filter")
private String filter;
/**
* The country name.
* The country of origin of this media item
*/
@JsonProperty("tag")
private String tag;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("filter")
private Optional<String> filter;
@JsonCreator
public GetMediaMetaDataCountry(
@JsonProperty("id") int id,
@JsonProperty("filter") String filter,
@JsonProperty("tag") String tag) {
@JsonProperty("tag") String tag,
@JsonProperty("filter") Optional<String> filter) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tag, "tag");
Utils.checkNotNull(filter, "filter");
this.id = id;
this.filter = filter;
this.tag = tag;
this.filter = filter;
}
public GetMediaMetaDataCountry(
int id,
String tag) {
this(id, tag, Optional.empty());
}
/**
* The unique country identifier.
*/
@JsonIgnore
public int id() {
return id;
}
/**
* The filter string for the country.
*/
@JsonIgnore
public String filter() {
return filter;
}
/**
* The country name.
* The country of origin of this media item
*/
@JsonIgnore
public String tag() {
return tag;
}
@JsonIgnore
public Optional<String> filter() {
return filter;
}
public final static Builder builder() {
return new Builder();
}
/**
* The unique country identifier.
*/
public GetMediaMetaDataCountry withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
@@ -83,16 +83,7 @@ public class GetMediaMetaDataCountry {
}
/**
* The filter string for the country.
*/
public GetMediaMetaDataCountry withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The country name.
* The country of origin of this media item
*/
public GetMediaMetaDataCountry withTag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -100,6 +91,18 @@ public class GetMediaMetaDataCountry {
return this;
}
public GetMediaMetaDataCountry withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = Optional.ofNullable(filter);
return this;
}
public GetMediaMetaDataCountry withFilter(Optional<String> filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
@@ -112,41 +115,38 @@ public class GetMediaMetaDataCountry {
GetMediaMetaDataCountry other = (GetMediaMetaDataCountry) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tag, other.tag);
Objects.deepEquals(this.tag, other.tag) &&
Objects.deepEquals(this.filter, other.filter);
}
@Override
public int hashCode() {
return Objects.hash(
id,
filter,
tag);
tag,
filter);
}
@Override
public String toString() {
return Utils.toString(GetMediaMetaDataCountry.class,
"id", id,
"filter", filter,
"tag", tag);
"tag", tag,
"filter", filter);
}
public final static class Builder {
private Integer id;
private String filter;
private String tag;
private Optional<String> filter = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* The unique country identifier.
*/
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
@@ -154,28 +154,31 @@ public class GetMediaMetaDataCountry {
}
/**
* The filter string for the country.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The country name.
* The country of origin of this media item
*/
public Builder tag(String tag) {
Utils.checkNotNull(tag, "tag");
this.tag = tag;
return this;
}
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = Optional.ofNullable(filter);
return this;
}
public Builder filter(Optional<String> filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
public GetMediaMetaDataCountry build() {
return new GetMediaMetaDataCountry(
id,
filter,
tag);
tag,
filter);
}
}
}

View File

@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
@@ -18,38 +18,32 @@ import java.util.Optional;
public class GetMediaMetaDataDirector {
/**
* The unique role identifier.
* Unique identifier for the director.
*/
@JsonProperty("id")
private long id;
private int id;
/**
* The filter string for the role.
*/
@JsonProperty("filter")
private String filter;
/**
* The actor's name.
* The role of Director
*/
@JsonProperty("tag")
private String tag;
/**
* A key associated with the actor tag.
* The filter string used to query this director.
*/
@JsonProperty("tagKey")
private String tagKey;
@JsonProperty("filter")
private String filter;
/**
* The character name or role.
* A unique key associated with the director's tag, used for internal identification.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("role")
private Optional<String> role;
@JsonProperty("tagKey")
private Optional<String> tagKey;
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the director.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("thumb")
@@ -57,52 +51,40 @@ public class GetMediaMetaDataDirector {
@JsonCreator
public GetMediaMetaDataDirector(
@JsonProperty("id") long id,
@JsonProperty("filter") String filter,
@JsonProperty("id") int id,
@JsonProperty("tag") String tag,
@JsonProperty("tagKey") String tagKey,
@JsonProperty("role") Optional<String> role,
@JsonProperty("filter") String filter,
@JsonProperty("tagKey") Optional<String> tagKey,
@JsonProperty("thumb") Optional<String> thumb) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tag, "tag");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tagKey, "tagKey");
Utils.checkNotNull(role, "role");
Utils.checkNotNull(thumb, "thumb");
this.id = id;
this.filter = filter;
this.tag = tag;
this.filter = filter;
this.tagKey = tagKey;
this.role = role;
this.thumb = thumb;
}
public GetMediaMetaDataDirector(
long id,
String filter,
int id,
String tag,
String tagKey) {
this(id, filter, tag, tagKey, Optional.empty(), Optional.empty());
String filter) {
this(id, tag, filter, Optional.empty(), Optional.empty());
}
/**
* The unique role identifier.
* Unique identifier for the director.
*/
@JsonIgnore
public long id() {
public int id() {
return id;
}
/**
* The filter string for the role.
*/
@JsonIgnore
public String filter() {
return filter;
}
/**
* The actor's name.
* The role of Director
*/
@JsonIgnore
public String tag() {
@@ -110,23 +92,23 @@ public class GetMediaMetaDataDirector {
}
/**
* A key associated with the actor tag.
* The filter string used to query this director.
*/
@JsonIgnore
public String tagKey() {
public String filter() {
return filter;
}
/**
* A unique key associated with the director's tag, used for internal identification.
*/
@JsonIgnore
public Optional<String> tagKey() {
return tagKey;
}
/**
* The character name or role.
*/
@JsonIgnore
public Optional<String> role() {
return role;
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the director.
*/
@JsonIgnore
public Optional<String> thumb() {
@@ -138,25 +120,16 @@ public class GetMediaMetaDataDirector {
}
/**
* The unique role identifier.
* Unique identifier for the director.
*/
public GetMediaMetaDataDirector withId(long id) {
public GetMediaMetaDataDirector withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The filter string for the role.
*/
public GetMediaMetaDataDirector withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The actor's name.
* The role of Director
*/
public GetMediaMetaDataDirector withTag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -165,34 +138,34 @@ public class GetMediaMetaDataDirector {
}
/**
* A key associated with the actor tag.
* The filter string used to query this director.
*/
public GetMediaMetaDataDirector withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* A unique key associated with the director's tag, used for internal identification.
*/
public GetMediaMetaDataDirector withTagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = Optional.ofNullable(tagKey);
return this;
}
/**
* A unique key associated with the director's tag, used for internal identification.
*/
public GetMediaMetaDataDirector withTagKey(Optional<String> tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
/**
* The character name or role.
*/
public GetMediaMetaDataDirector withRole(String role) {
Utils.checkNotNull(role, "role");
this.role = Optional.ofNullable(role);
return this;
}
/**
* The character name or role.
*/
public GetMediaMetaDataDirector withRole(Optional<String> role) {
Utils.checkNotNull(role, "role");
this.role = role;
return this;
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the director.
*/
public GetMediaMetaDataDirector withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -201,7 +174,7 @@ public class GetMediaMetaDataDirector {
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the director.
*/
public GetMediaMetaDataDirector withThumb(Optional<String> thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -221,10 +194,9 @@ public class GetMediaMetaDataDirector {
GetMediaMetaDataDirector other = (GetMediaMetaDataDirector) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tag, other.tag) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tagKey, other.tagKey) &&
Objects.deepEquals(this.role, other.role) &&
Objects.deepEquals(this.thumb, other.thumb);
}
@@ -232,10 +204,9 @@ public class GetMediaMetaDataDirector {
public int hashCode() {
return Objects.hash(
id,
filter,
tag,
filter,
tagKey,
role,
thumb);
}
@@ -243,24 +214,21 @@ public class GetMediaMetaDataDirector {
public String toString() {
return Utils.toString(GetMediaMetaDataDirector.class,
"id", id,
"filter", filter,
"tag", tag,
"filter", filter,
"tagKey", tagKey,
"role", role,
"thumb", thumb);
}
public final static class Builder {
private Long id;
private String filter;
private Integer id;
private String tag;
private String tagKey;
private String filter;
private Optional<String> role = Optional.empty();
private Optional<String> tagKey = Optional.empty();
private Optional<String> thumb = Optional.empty();
@@ -269,25 +237,16 @@ public class GetMediaMetaDataDirector {
}
/**
* The unique role identifier.
* Unique identifier for the director.
*/
public Builder id(long id) {
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The filter string for the role.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The actor's name.
* The role of Director
*/
public Builder tag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -296,34 +255,34 @@ public class GetMediaMetaDataDirector {
}
/**
* A key associated with the actor tag.
* The filter string used to query this director.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* A unique key associated with the director's tag, used for internal identification.
*/
public Builder tagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = Optional.ofNullable(tagKey);
return this;
}
/**
* A unique key associated with the director's tag, used for internal identification.
*/
public Builder tagKey(Optional<String> tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
/**
* The character name or role.
*/
public Builder role(String role) {
Utils.checkNotNull(role, "role");
this.role = Optional.ofNullable(role);
return this;
}
/**
* The character name or role.
*/
public Builder role(Optional<String> role) {
Utils.checkNotNull(role, "role");
this.role = role;
return this;
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the director.
*/
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -332,7 +291,7 @@ public class GetMediaMetaDataDirector {
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the director.
*/
public Builder thumb(Optional<String> thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -343,10 +302,9 @@ public class GetMediaMetaDataDirector {
public GetMediaMetaDataDirector build() {
return new GetMediaMetaDataDirector(
id,
filter,
tag,
filter,
tagKey,
role,
thumb);
}
}

View File

@@ -12,70 +12,60 @@ import java.lang.Override;
import java.lang.String;
import java.util.Objects;
/**
* GetMediaMetaDataGenre
*
* <p>The filter query string for similar items.
*/
public class GetMediaMetaDataGenre {
/**
* The unique genre identifier.
*/
@JsonProperty("id")
private long id;
/**
* The filter string for the genre.
*/
@JsonProperty("filter")
private String filter;
/**
* The genre name.
* The genre name of this media-item
*/
@JsonProperty("tag")
private String tag;
@JsonProperty("filter")
private String filter;
@JsonCreator
public GetMediaMetaDataGenre(
@JsonProperty("id") long id,
@JsonProperty("filter") String filter,
@JsonProperty("tag") String tag) {
@JsonProperty("tag") String tag,
@JsonProperty("filter") String filter) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tag, "tag");
Utils.checkNotNull(filter, "filter");
this.id = id;
this.filter = filter;
this.tag = tag;
this.filter = filter;
}
/**
* The unique genre identifier.
*/
@JsonIgnore
public long id() {
return id;
}
/**
* The filter string for the genre.
*/
@JsonIgnore
public String filter() {
return filter;
}
/**
* The genre name.
* The genre name of this media-item
*/
@JsonIgnore
public String tag() {
return tag;
}
@JsonIgnore
public String filter() {
return filter;
}
public final static Builder builder() {
return new Builder();
}
/**
* The unique genre identifier.
*/
public GetMediaMetaDataGenre withId(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
@@ -83,16 +73,7 @@ public class GetMediaMetaDataGenre {
}
/**
* The filter string for the genre.
*/
public GetMediaMetaDataGenre withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The genre name.
* The genre name of this media-item
*/
public GetMediaMetaDataGenre withTag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -100,6 +81,12 @@ public class GetMediaMetaDataGenre {
return this;
}
public GetMediaMetaDataGenre withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
@@ -112,41 +99,38 @@ public class GetMediaMetaDataGenre {
GetMediaMetaDataGenre other = (GetMediaMetaDataGenre) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tag, other.tag);
Objects.deepEquals(this.tag, other.tag) &&
Objects.deepEquals(this.filter, other.filter);
}
@Override
public int hashCode() {
return Objects.hash(
id,
filter,
tag);
tag,
filter);
}
@Override
public String toString() {
return Utils.toString(GetMediaMetaDataGenre.class,
"id", id,
"filter", filter,
"tag", tag);
"tag", tag,
"filter", filter);
}
public final static class Builder {
private Long id;
private String filter;
private String tag;
private String filter;
private Builder() {
// force use of static builder() method
}
/**
* The unique genre identifier.
*/
public Builder id(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
@@ -154,28 +138,25 @@ public class GetMediaMetaDataGenre {
}
/**
* The filter string for the genre.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The genre name.
* The genre name of this media-item
*/
public Builder tag(String tag) {
Utils.checkNotNull(tag, "tag");
this.tag = tag;
return this;
}
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
public GetMediaMetaDataGenre build() {
return new GetMediaMetaDataGenre(
id,
filter,
tag);
tag,
filter);
}
}
}

View File

@@ -13,28 +13,19 @@ import java.util.Objects;
public class GetMediaMetaDataImage {
/**
* Alternate text for the image.
*/
@JsonProperty("alt")
private String alt;
/**
* The type of image (e.g., coverPoster, background, clearLogo).
*/
@JsonProperty("type")
private String type;
private GetMediaMetaDataLibraryType type;
/**
* The URL of the image.
*/
@JsonProperty("url")
private String url;
@JsonCreator
public GetMediaMetaDataImage(
@JsonProperty("alt") String alt,
@JsonProperty("type") String type,
@JsonProperty("type") GetMediaMetaDataLibraryType type,
@JsonProperty("url") String url) {
Utils.checkNotNull(alt, "alt");
Utils.checkNotNull(type, "type");
@@ -44,25 +35,16 @@ public class GetMediaMetaDataImage {
this.url = url;
}
/**
* Alternate text for the image.
*/
@JsonIgnore
public String alt() {
return alt;
}
/**
* The type of image (e.g., coverPoster, background, clearLogo).
*/
@JsonIgnore
public String type() {
public GetMediaMetaDataLibraryType type() {
return type;
}
/**
* The URL of the image.
*/
@JsonIgnore
public String url() {
return url;
@@ -72,27 +54,18 @@ public class GetMediaMetaDataImage {
return new Builder();
}
/**
* Alternate text for the image.
*/
public GetMediaMetaDataImage withAlt(String alt) {
Utils.checkNotNull(alt, "alt");
this.alt = alt;
return this;
}
/**
* The type of image (e.g., coverPoster, background, clearLogo).
*/
public GetMediaMetaDataImage withType(String type) {
public GetMediaMetaDataImage withType(GetMediaMetaDataLibraryType type) {
Utils.checkNotNull(type, "type");
this.type = type;
return this;
}
/**
* The URL of the image.
*/
public GetMediaMetaDataImage withUrl(String url) {
Utils.checkNotNull(url, "url");
this.url = url;
@@ -135,7 +108,7 @@ public class GetMediaMetaDataImage {
private String alt;
private String type;
private GetMediaMetaDataLibraryType type;
private String url;
@@ -143,27 +116,18 @@ public class GetMediaMetaDataImage {
// force use of static builder() method
}
/**
* Alternate text for the image.
*/
public Builder alt(String alt) {
Utils.checkNotNull(alt, "alt");
this.alt = alt;
return this;
}
/**
* The type of image (e.g., coverPoster, background, clearLogo).
*/
public Builder type(String type) {
public Builder type(GetMediaMetaDataLibraryType type) {
Utils.checkNotNull(type, "type");
this.type = type;
return this;
}
/**
* The URL of the image.
*/
public Builder url(String url) {
Utils.checkNotNull(url, "url");
this.url = url;

View File

@@ -0,0 +1,187 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
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).
*
*/
@JsonDeserialize(using = GetMediaMetaDataLibraryType._Deserializer.class)
@JsonSerialize(using = GetMediaMetaDataLibraryType._Serializer.class)
public class GetMediaMetaDataLibraryType {
public static final GetMediaMetaDataLibraryType COVER_POSTER = new GetMediaMetaDataLibraryType("coverPoster");
public static final GetMediaMetaDataLibraryType BACKGROUND = new GetMediaMetaDataLibraryType("background");
public static final GetMediaMetaDataLibraryType SNAPSHOT = new GetMediaMetaDataLibraryType("snapshot");
public static final GetMediaMetaDataLibraryType CLEAR_LOGO = new GetMediaMetaDataLibraryType("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, GetMediaMetaDataLibraryType> values = createValuesMap();
private static final Map<String, GetMediaMetaDataLibraryTypeEnum> enums = createEnumsMap();
private final String value;
private GetMediaMetaDataLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetMediaMetaDataLibraryType 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 GetMediaMetaDataLibraryType
*/
public static GetMediaMetaDataLibraryType of(String value) {
synchronized (GetMediaMetaDataLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetMediaMetaDataLibraryType(v));
}
}
public String value() {
return value;
}
public Optional<GetMediaMetaDataLibraryTypeEnum> 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;
GetMediaMetaDataLibraryType other = (GetMediaMetaDataLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetMediaMetaDataLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetMediaMetaDataLibraryType[] values() {
synchronized (GetMediaMetaDataLibraryType.class) {
return values.values().toArray(new GetMediaMetaDataLibraryType[] {});
}
}
private static final Map<String, GetMediaMetaDataLibraryType> createValuesMap() {
Map<String, GetMediaMetaDataLibraryType> 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, GetMediaMetaDataLibraryTypeEnum> createEnumsMap() {
Map<String, GetMediaMetaDataLibraryTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetMediaMetaDataLibraryTypeEnum.COVER_POSTER);
map.put("background", GetMediaMetaDataLibraryTypeEnum.BACKGROUND);
map.put("snapshot", GetMediaMetaDataLibraryTypeEnum.SNAPSHOT);
map.put("clearLogo", GetMediaMetaDataLibraryTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetMediaMetaDataLibraryType> {
protected _Serializer() {
super(GetMediaMetaDataLibraryType.class);
}
@Override
public void serialize(GetMediaMetaDataLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetMediaMetaDataLibraryType> {
protected _Deserializer() {
super(GetMediaMetaDataLibraryType.class);
}
@Override
public GetMediaMetaDataLibraryType 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 GetMediaMetaDataLibraryType.of(v);
}
}
public enum GetMediaMetaDataLibraryTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetMediaMetaDataLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
}
}

View File

@@ -18,38 +18,39 @@ import java.util.Optional;
public class GetMediaMetaDataRole {
/**
* The unique role identifier.
* Unique identifier for the actor or role.
*/
@JsonProperty("id")
private long id;
/**
* The filter string for the role.
*/
@JsonProperty("filter")
private String filter;
/**
* The actor's name.
* The display tag for the actor (typically the actor's name).
*/
@JsonProperty("tag")
private String tag;
/**
* A key associated with the actor tag.
*/
@JsonProperty("tagKey")
private String tagKey;
/**
* The character name or role.
* The role played by the actor in the media item.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("role")
private Optional<String> role;
/**
* URL for the role thumbnail image.
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
*/
@JsonProperty("filter")
private String filter;
/**
* A unique key associated with the actor's tag, used for internal identification.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("tagKey")
private Optional<String> tagKey;
/**
* The URL of the thumbnail image for the actor.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("thumb")
@@ -58,35 +59,34 @@ public class GetMediaMetaDataRole {
@JsonCreator
public GetMediaMetaDataRole(
@JsonProperty("id") long id,
@JsonProperty("filter") String filter,
@JsonProperty("tag") String tag,
@JsonProperty("tagKey") String tagKey,
@JsonProperty("role") Optional<String> role,
@JsonProperty("filter") String filter,
@JsonProperty("tagKey") Optional<String> tagKey,
@JsonProperty("thumb") Optional<String> thumb) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tag, "tag");
Utils.checkNotNull(tagKey, "tagKey");
Utils.checkNotNull(role, "role");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tagKey, "tagKey");
Utils.checkNotNull(thumb, "thumb");
this.id = id;
this.filter = filter;
this.tag = tag;
this.tagKey = tagKey;
this.role = role;
this.filter = filter;
this.tagKey = tagKey;
this.thumb = thumb;
}
public GetMediaMetaDataRole(
long id,
String filter,
String tag,
String tagKey) {
this(id, filter, tag, tagKey, Optional.empty(), Optional.empty());
String filter) {
this(id, tag, Optional.empty(), filter, Optional.empty(), Optional.empty());
}
/**
* The unique role identifier.
* Unique identifier for the actor or role.
*/
@JsonIgnore
public long id() {
@@ -94,15 +94,7 @@ public class GetMediaMetaDataRole {
}
/**
* The filter string for the role.
*/
@JsonIgnore
public String filter() {
return filter;
}
/**
* The actor's name.
* The display tag for the actor (typically the actor's name).
*/
@JsonIgnore
public String tag() {
@@ -110,15 +102,7 @@ public class GetMediaMetaDataRole {
}
/**
* A key associated with the actor tag.
*/
@JsonIgnore
public String tagKey() {
return tagKey;
}
/**
* The character name or role.
* The role played by the actor in the media item.
*/
@JsonIgnore
public Optional<String> role() {
@@ -126,7 +110,23 @@ public class GetMediaMetaDataRole {
}
/**
* URL for the role thumbnail image.
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
*/
@JsonIgnore
public String filter() {
return filter;
}
/**
* A unique key associated with the actor's tag, used for internal identification.
*/
@JsonIgnore
public Optional<String> tagKey() {
return tagKey;
}
/**
* The URL of the thumbnail image for the actor.
*/
@JsonIgnore
public Optional<String> thumb() {
@@ -138,7 +138,7 @@ public class GetMediaMetaDataRole {
}
/**
* The unique role identifier.
* Unique identifier for the actor or role.
*/
public GetMediaMetaDataRole withId(long id) {
Utils.checkNotNull(id, "id");
@@ -147,16 +147,7 @@ public class GetMediaMetaDataRole {
}
/**
* The filter string for the role.
*/
public GetMediaMetaDataRole withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The actor's name.
* The display tag for the actor (typically the actor's name).
*/
public GetMediaMetaDataRole withTag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -165,16 +156,7 @@ public class GetMediaMetaDataRole {
}
/**
* A key associated with the actor tag.
*/
public GetMediaMetaDataRole withTagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
/**
* The character name or role.
* The role played by the actor in the media item.
*/
public GetMediaMetaDataRole withRole(String role) {
Utils.checkNotNull(role, "role");
@@ -183,7 +165,7 @@ public class GetMediaMetaDataRole {
}
/**
* The character name or role.
* The role played by the actor in the media item.
*/
public GetMediaMetaDataRole withRole(Optional<String> role) {
Utils.checkNotNull(role, "role");
@@ -192,7 +174,34 @@ public class GetMediaMetaDataRole {
}
/**
* URL for the role thumbnail image.
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
*/
public GetMediaMetaDataRole withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* A unique key associated with the actor's tag, used for internal identification.
*/
public GetMediaMetaDataRole withTagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = Optional.ofNullable(tagKey);
return this;
}
/**
* A unique key associated with the actor's tag, used for internal identification.
*/
public GetMediaMetaDataRole withTagKey(Optional<String> tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
/**
* The URL of the thumbnail image for the actor.
*/
public GetMediaMetaDataRole withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -201,7 +210,7 @@ public class GetMediaMetaDataRole {
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the actor.
*/
public GetMediaMetaDataRole withThumb(Optional<String> thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -221,10 +230,10 @@ public class GetMediaMetaDataRole {
GetMediaMetaDataRole other = (GetMediaMetaDataRole) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tag, other.tag) &&
Objects.deepEquals(this.tagKey, other.tagKey) &&
Objects.deepEquals(this.role, other.role) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tagKey, other.tagKey) &&
Objects.deepEquals(this.thumb, other.thumb);
}
@@ -232,10 +241,10 @@ public class GetMediaMetaDataRole {
public int hashCode() {
return Objects.hash(
id,
filter,
tag,
tagKey,
role,
filter,
tagKey,
thumb);
}
@@ -243,10 +252,10 @@ public class GetMediaMetaDataRole {
public String toString() {
return Utils.toString(GetMediaMetaDataRole.class,
"id", id,
"filter", filter,
"tag", tag,
"tagKey", tagKey,
"role", role,
"filter", filter,
"tagKey", tagKey,
"thumb", thumb);
}
@@ -254,14 +263,14 @@ public class GetMediaMetaDataRole {
private Long id;
private String filter;
private String tag;
private String tagKey;
private Optional<String> role = Optional.empty();
private String filter;
private Optional<String> tagKey = Optional.empty();
private Optional<String> thumb = Optional.empty();
private Builder() {
@@ -269,7 +278,7 @@ public class GetMediaMetaDataRole {
}
/**
* The unique role identifier.
* Unique identifier for the actor or role.
*/
public Builder id(long id) {
Utils.checkNotNull(id, "id");
@@ -278,16 +287,7 @@ public class GetMediaMetaDataRole {
}
/**
* The filter string for the role.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The actor's name.
* The display tag for the actor (typically the actor's name).
*/
public Builder tag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -296,16 +296,7 @@ public class GetMediaMetaDataRole {
}
/**
* A key associated with the actor tag.
*/
public Builder tagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
/**
* The character name or role.
* The role played by the actor in the media item.
*/
public Builder role(String role) {
Utils.checkNotNull(role, "role");
@@ -314,7 +305,7 @@ public class GetMediaMetaDataRole {
}
/**
* The character name or role.
* The role played by the actor in the media item.
*/
public Builder role(Optional<String> role) {
Utils.checkNotNull(role, "role");
@@ -323,7 +314,34 @@ public class GetMediaMetaDataRole {
}
/**
* URL for the role thumbnail image.
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* A unique key associated with the actor's tag, used for internal identification.
*/
public Builder tagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = Optional.ofNullable(tagKey);
return this;
}
/**
* A unique key associated with the actor's tag, used for internal identification.
*/
public Builder tagKey(Optional<String> tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
/**
* The URL of the thumbnail image for the actor.
*/
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -332,7 +350,7 @@ public class GetMediaMetaDataRole {
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the actor.
*/
public Builder thumb(Optional<String> thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -343,10 +361,10 @@ public class GetMediaMetaDataRole {
public GetMediaMetaDataRole build() {
return new GetMediaMetaDataRole(
id,
filter,
tag,
tagKey,
role,
filter,
tagKey,
thumb);
}
}

View File

@@ -27,10 +27,20 @@ public class GetMediaMetaDataStream {
private long id;
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonProperty("streamType")
private int streamType;
private GetMediaMetaDataStreamType streamType;
/**
* Format of the stream (e.g., srt).
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("format")
private Optional<String> format;
/**
* Indicates if this stream is default.
@@ -48,8 +58,9 @@ public class GetMediaMetaDataStream {
/**
* Index of the stream.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("index")
private int index;
private Optional<Integer> index;
/**
* Bitrate of the stream.
@@ -216,6 +227,13 @@ public class GetMediaMetaDataStream {
@JsonProperty("frameRate")
private Optional<Float> frameRate;
/**
* Key to access this stream part.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("key")
private Optional<String> key;
/**
* Height of the video stream.
*/
@@ -345,10 +363,11 @@ public class GetMediaMetaDataStream {
@JsonCreator
public GetMediaMetaDataStream(
@JsonProperty("id") long id,
@JsonProperty("streamType") int streamType,
@JsonProperty("streamType") GetMediaMetaDataStreamType streamType,
@JsonProperty("format") Optional<String> format,
@JsonProperty("default") Optional<Boolean> default_,
@JsonProperty("codec") String codec,
@JsonProperty("index") int index,
@JsonProperty("index") Optional<Integer> index,
@JsonProperty("bitrate") Optional<Integer> bitrate,
@JsonProperty("language") Optional<String> language,
@JsonProperty("languageTag") Optional<String> languageTag,
@@ -373,6 +392,7 @@ public class GetMediaMetaDataStream {
@JsonProperty("colorSpace") Optional<String> colorSpace,
@JsonProperty("colorTrc") Optional<String> colorTrc,
@JsonProperty("frameRate") Optional<Float> frameRate,
@JsonProperty("key") Optional<String> key,
@JsonProperty("height") Optional<Integer> height,
@JsonProperty("level") Optional<Integer> level,
@JsonProperty("original") Optional<Boolean> original,
@@ -395,6 +415,7 @@ public class GetMediaMetaDataStream {
@JsonProperty("title") Optional<String> title) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(streamType, "streamType");
Utils.checkNotNull(format, "format");
Utils.checkNotNull(default_, "default_");
Utils.checkNotNull(codec, "codec");
Utils.checkNotNull(index, "index");
@@ -422,6 +443,7 @@ public class GetMediaMetaDataStream {
Utils.checkNotNull(colorSpace, "colorSpace");
Utils.checkNotNull(colorTrc, "colorTrc");
Utils.checkNotNull(frameRate, "frameRate");
Utils.checkNotNull(key, "key");
Utils.checkNotNull(height, "height");
Utils.checkNotNull(level, "level");
Utils.checkNotNull(original, "original");
@@ -444,6 +466,7 @@ public class GetMediaMetaDataStream {
Utils.checkNotNull(title, "title");
this.id = id;
this.streamType = streamType;
this.format = format;
this.default_ = default_;
this.codec = codec;
this.index = index;
@@ -471,6 +494,7 @@ public class GetMediaMetaDataStream {
this.colorSpace = colorSpace;
this.colorTrc = colorTrc;
this.frameRate = frameRate;
this.key = key;
this.height = height;
this.level = level;
this.original = original;
@@ -495,12 +519,11 @@ public class GetMediaMetaDataStream {
public GetMediaMetaDataStream(
long id,
int streamType,
GetMediaMetaDataStreamType streamType,
String codec,
int index,
String displayTitle,
String extendedDisplayTitle) {
this(id, streamType, Optional.empty(), codec, index, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
this(id, streamType, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -512,13 +535,24 @@ public class GetMediaMetaDataStream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonIgnore
public int streamType() {
public GetMediaMetaDataStreamType streamType() {
return streamType;
}
/**
* Format of the stream (e.g., srt).
*/
@JsonIgnore
public Optional<String> format() {
return format;
}
/**
* Indicates if this stream is default.
*/
@@ -539,7 +573,7 @@ public class GetMediaMetaDataStream {
* Index of the stream.
*/
@JsonIgnore
public int index() {
public Optional<Integer> index() {
return index;
}
@@ -732,6 +766,14 @@ public class GetMediaMetaDataStream {
return frameRate;
}
/**
* Key to access this stream part.
*/
@JsonIgnore
public Optional<String> key() {
return key;
}
/**
* Height of the video stream.
*/
@@ -894,14 +936,35 @@ public class GetMediaMetaDataStream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
public GetMediaMetaDataStream withStreamType(int streamType) {
public GetMediaMetaDataStream withStreamType(GetMediaMetaDataStreamType streamType) {
Utils.checkNotNull(streamType, "streamType");
this.streamType = streamType;
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public GetMediaMetaDataStream withFormat(String format) {
Utils.checkNotNull(format, "format");
this.format = Optional.ofNullable(format);
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public GetMediaMetaDataStream withFormat(Optional<String> format) {
Utils.checkNotNull(format, "format");
this.format = format;
return this;
}
/**
* Indicates if this stream is default.
*/
@@ -933,6 +996,15 @@ public class GetMediaMetaDataStream {
* Index of the stream.
*/
public GetMediaMetaDataStream withIndex(int index) {
Utils.checkNotNull(index, "index");
this.index = Optional.ofNullable(index);
return this;
}
/**
* Index of the stream.
*/
public GetMediaMetaDataStream withIndex(Optional<Integer> index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
@@ -1364,6 +1436,24 @@ public class GetMediaMetaDataStream {
return this;
}
/**
* Key to access this stream part.
*/
public GetMediaMetaDataStream withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = Optional.ofNullable(key);
return this;
}
/**
* Key to access this stream part.
*/
public GetMediaMetaDataStream withKey(Optional<String> key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* Height of the video stream.
*/
@@ -1695,6 +1785,7 @@ public class GetMediaMetaDataStream {
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.streamType, other.streamType) &&
Objects.deepEquals(this.format, other.format) &&
Objects.deepEquals(this.default_, other.default_) &&
Objects.deepEquals(this.codec, other.codec) &&
Objects.deepEquals(this.index, other.index) &&
@@ -1722,6 +1813,7 @@ public class GetMediaMetaDataStream {
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
Objects.deepEquals(this.frameRate, other.frameRate) &&
Objects.deepEquals(this.key, other.key) &&
Objects.deepEquals(this.height, other.height) &&
Objects.deepEquals(this.level, other.level) &&
Objects.deepEquals(this.original, other.original) &&
@@ -1749,6 +1841,7 @@ public class GetMediaMetaDataStream {
return Objects.hash(
id,
streamType,
format,
default_,
codec,
index,
@@ -1776,6 +1869,7 @@ public class GetMediaMetaDataStream {
colorSpace,
colorTrc,
frameRate,
key,
height,
level,
original,
@@ -1803,6 +1897,7 @@ public class GetMediaMetaDataStream {
return Utils.toString(GetMediaMetaDataStream.class,
"id", id,
"streamType", streamType,
"format", format,
"default_", default_,
"codec", codec,
"index", index,
@@ -1830,6 +1925,7 @@ public class GetMediaMetaDataStream {
"colorSpace", colorSpace,
"colorTrc", colorTrc,
"frameRate", frameRate,
"key", key,
"height", height,
"level", level,
"original", original,
@@ -1856,13 +1952,15 @@ public class GetMediaMetaDataStream {
private Long id;
private Integer streamType;
private GetMediaMetaDataStreamType streamType;
private Optional<String> format = Optional.empty();
private Optional<Boolean> default_ = Optional.empty();
private String codec;
private Integer index;
private Optional<Integer> index = Optional.empty();
private Optional<Integer> bitrate = Optional.empty();
@@ -1912,6 +2010,8 @@ public class GetMediaMetaDataStream {
private Optional<Float> frameRate = Optional.empty();
private Optional<String> key = Optional.empty();
private Optional<Integer> height = Optional.empty();
private Optional<Integer> level = Optional.empty();
@@ -1966,14 +2066,35 @@ public class GetMediaMetaDataStream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
public Builder streamType(int streamType) {
public Builder streamType(GetMediaMetaDataStreamType streamType) {
Utils.checkNotNull(streamType, "streamType");
this.streamType = streamType;
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Builder format(String format) {
Utils.checkNotNull(format, "format");
this.format = Optional.ofNullable(format);
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Builder format(Optional<String> format) {
Utils.checkNotNull(format, "format");
this.format = format;
return this;
}
/**
* Indicates if this stream is default.
*/
@@ -2005,6 +2126,15 @@ public class GetMediaMetaDataStream {
* Index of the stream.
*/
public Builder index(int index) {
Utils.checkNotNull(index, "index");
this.index = Optional.ofNullable(index);
return this;
}
/**
* Index of the stream.
*/
public Builder index(Optional<Integer> index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
@@ -2436,6 +2566,24 @@ public class GetMediaMetaDataStream {
return this;
}
/**
* Key to access this stream part.
*/
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = Optional.ofNullable(key);
return this;
}
/**
* Key to access this stream part.
*/
public Builder key(Optional<String> key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* Height of the video stream.
*/
@@ -2758,6 +2906,7 @@ public class GetMediaMetaDataStream {
return new GetMediaMetaDataStream(
id,
streamType,
format,
default_,
codec,
index,
@@ -2785,6 +2934,7 @@ public class GetMediaMetaDataStream {
colorSpace,
colorTrc,
frameRate,
key,
height,
level,
original,

View File

@@ -0,0 +1,192 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
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.Integer;
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).
*
*/
/**
* GetMediaMetaDataStreamType
*
* <p>Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonDeserialize(using = GetMediaMetaDataStreamType._Deserializer.class)
@JsonSerialize(using = GetMediaMetaDataStreamType._Serializer.class)
public class GetMediaMetaDataStreamType {
public static final GetMediaMetaDataStreamType Video = new GetMediaMetaDataStreamType(1);
public static final GetMediaMetaDataStreamType Audio = new GetMediaMetaDataStreamType(2);
public static final GetMediaMetaDataStreamType Subtitle = new GetMediaMetaDataStreamType(3);
// 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<Integer, GetMediaMetaDataStreamType> values = createValuesMap();
private static final Map<Integer, GetMediaMetaDataStreamTypeEnum> enums = createEnumsMap();
private final int value;
private GetMediaMetaDataStreamType(int value) {
this.value = value;
}
/**
* Returns a GetMediaMetaDataStreamType 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 GetMediaMetaDataStreamType
*/
public static GetMediaMetaDataStreamType of(int value) {
synchronized (GetMediaMetaDataStreamType.class) {
return values.computeIfAbsent(value, v -> new GetMediaMetaDataStreamType(v));
}
}
public int value() {
return value;
}
public Optional<GetMediaMetaDataStreamTypeEnum> 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;
GetMediaMetaDataStreamType other = (GetMediaMetaDataStreamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetMediaMetaDataStreamType [value=" + value + "]";
}
// return an array just like an enum
public static GetMediaMetaDataStreamType[] values() {
synchronized (GetMediaMetaDataStreamType.class) {
return values.values().toArray(new GetMediaMetaDataStreamType[] {});
}
}
private static final Map<Integer, GetMediaMetaDataStreamType> createValuesMap() {
Map<Integer, GetMediaMetaDataStreamType> map = new LinkedHashMap<>();
map.put(1, Video);
map.put(2, Audio);
map.put(3, Subtitle);
return map;
}
private static final Map<Integer, GetMediaMetaDataStreamTypeEnum> createEnumsMap() {
Map<Integer, GetMediaMetaDataStreamTypeEnum> map = new HashMap<>();
map.put(1, GetMediaMetaDataStreamTypeEnum.Video);
map.put(2, GetMediaMetaDataStreamTypeEnum.Audio);
map.put(3, GetMediaMetaDataStreamTypeEnum.Subtitle);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetMediaMetaDataStreamType> {
protected _Serializer() {
super(GetMediaMetaDataStreamType.class);
}
@Override
public void serialize(GetMediaMetaDataStreamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetMediaMetaDataStreamType> {
protected _Deserializer() {
super(GetMediaMetaDataStreamType.class);
}
@Override
public GetMediaMetaDataStreamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
int v = p.readValueAs(new TypeReference<Integer>() {});
// use the factory method to ensure we get singletons
return GetMediaMetaDataStreamType.of(v);
}
}
public enum GetMediaMetaDataStreamTypeEnum {
Video(1),
Audio(2),
Subtitle(3),;
private final int value;
private GetMediaMetaDataStreamTypeEnum(int value) {
this.value = value;
}
public int value() {
return value;
}
}
}

View File

@@ -0,0 +1,200 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
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).
*
*/
/**
* GetMediaMetaDataType
*
* <p>The type of media content
*/
@JsonDeserialize(using = GetMediaMetaDataType._Deserializer.class)
@JsonSerialize(using = GetMediaMetaDataType._Serializer.class)
public class GetMediaMetaDataType {
public static final GetMediaMetaDataType Movie = new GetMediaMetaDataType("movie");
public static final GetMediaMetaDataType TvShow = new GetMediaMetaDataType("show");
public static final GetMediaMetaDataType Season = new GetMediaMetaDataType("season");
public static final GetMediaMetaDataType Episode = new GetMediaMetaDataType("episode");
public static final GetMediaMetaDataType Artist = new GetMediaMetaDataType("artist");
public static final GetMediaMetaDataType Album = new GetMediaMetaDataType("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, GetMediaMetaDataType> values = createValuesMap();
private static final Map<String, GetMediaMetaDataTypeEnum> enums = createEnumsMap();
private final String value;
private GetMediaMetaDataType(String value) {
this.value = value;
}
/**
* Returns a GetMediaMetaDataType 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 GetMediaMetaDataType
*/
public static GetMediaMetaDataType of(String value) {
synchronized (GetMediaMetaDataType.class) {
return values.computeIfAbsent(value, v -> new GetMediaMetaDataType(v));
}
}
public String value() {
return value;
}
public Optional<GetMediaMetaDataTypeEnum> 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;
GetMediaMetaDataType other = (GetMediaMetaDataType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetMediaMetaDataType [value=" + value + "]";
}
// return an array just like an enum
public static GetMediaMetaDataType[] values() {
synchronized (GetMediaMetaDataType.class) {
return values.values().toArray(new GetMediaMetaDataType[] {});
}
}
private static final Map<String, GetMediaMetaDataType> createValuesMap() {
Map<String, GetMediaMetaDataType> 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, GetMediaMetaDataTypeEnum> createEnumsMap() {
Map<String, GetMediaMetaDataTypeEnum> map = new HashMap<>();
map.put("movie", GetMediaMetaDataTypeEnum.Movie);
map.put("show", GetMediaMetaDataTypeEnum.TvShow);
map.put("season", GetMediaMetaDataTypeEnum.Season);
map.put("episode", GetMediaMetaDataTypeEnum.Episode);
map.put("artist", GetMediaMetaDataTypeEnum.Artist);
map.put("album", GetMediaMetaDataTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetMediaMetaDataType> {
protected _Serializer() {
super(GetMediaMetaDataType.class);
}
@Override
public void serialize(GetMediaMetaDataType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetMediaMetaDataType> {
protected _Deserializer() {
super(GetMediaMetaDataType.class);
}
@Override
public GetMediaMetaDataType 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 GetMediaMetaDataType.of(v);
}
}
public enum GetMediaMetaDataTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetMediaMetaDataTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
}
}

View File

@@ -13,27 +13,15 @@ import java.util.Objects;
public class GetMediaMetaDataUltraBlurColors {
/**
* The top-left color value.
*/
@JsonProperty("topLeft")
private String topLeft;
/**
* The top-right color value.
*/
@JsonProperty("topRight")
private String topRight;
/**
* The bottom-right color value.
*/
@JsonProperty("bottomRight")
private String bottomRight;
/**
* The bottom-left color value.
*/
@JsonProperty("bottomLeft")
private String bottomLeft;
@@ -53,33 +41,21 @@ public class GetMediaMetaDataUltraBlurColors {
this.bottomLeft = bottomLeft;
}
/**
* The top-left color value.
*/
@JsonIgnore
public String topLeft() {
return topLeft;
}
/**
* The top-right color value.
*/
@JsonIgnore
public String topRight() {
return topRight;
}
/**
* The bottom-right color value.
*/
@JsonIgnore
public String bottomRight() {
return bottomRight;
}
/**
* The bottom-left color value.
*/
@JsonIgnore
public String bottomLeft() {
return bottomLeft;
@@ -89,36 +65,24 @@ public class GetMediaMetaDataUltraBlurColors {
return new Builder();
}
/**
* The top-left color value.
*/
public GetMediaMetaDataUltraBlurColors withTopLeft(String topLeft) {
Utils.checkNotNull(topLeft, "topLeft");
this.topLeft = topLeft;
return this;
}
/**
* The top-right color value.
*/
public GetMediaMetaDataUltraBlurColors withTopRight(String topRight) {
Utils.checkNotNull(topRight, "topRight");
this.topRight = topRight;
return this;
}
/**
* The bottom-right color value.
*/
public GetMediaMetaDataUltraBlurColors withBottomRight(String bottomRight) {
Utils.checkNotNull(bottomRight, "bottomRight");
this.bottomRight = bottomRight;
return this;
}
/**
* The bottom-left color value.
*/
public GetMediaMetaDataUltraBlurColors withBottomLeft(String bottomLeft) {
Utils.checkNotNull(bottomLeft, "bottomLeft");
this.bottomLeft = bottomLeft;
@@ -174,36 +138,24 @@ public class GetMediaMetaDataUltraBlurColors {
// force use of static builder() method
}
/**
* The top-left color value.
*/
public Builder topLeft(String topLeft) {
Utils.checkNotNull(topLeft, "topLeft");
this.topLeft = topLeft;
return this;
}
/**
* The top-right color value.
*/
public Builder topRight(String topRight) {
Utils.checkNotNull(topRight, "topRight");
this.topRight = topRight;
return this;
}
/**
* The bottom-right color value.
*/
public Builder bottomRight(String bottomRight) {
Utils.checkNotNull(bottomRight, "bottomRight");
this.bottomRight = bottomRight;
return this;
}
/**
* The bottom-left color value.
*/
public Builder bottomLeft(String bottomLeft) {
Utils.checkNotNull(bottomLeft, "bottomLeft");
this.bottomLeft = bottomLeft;

View File

@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
@@ -18,91 +18,73 @@ import java.util.Optional;
public class GetMediaMetaDataWriter {
/**
* The unique role identifier.
* Unique identifier for the writer.
*/
@JsonProperty("id")
private long id;
private int id;
/**
* The filter string for the role.
*/
@JsonProperty("filter")
private String filter;
/**
* The actor's name.
* The role of Writer
*/
@JsonProperty("tag")
private String tag;
/**
* A key associated with the actor tag.
* The filter string used to query this writer.
*/
@JsonProperty("tagKey")
private String tagKey;
@JsonProperty("filter")
private String filter;
/**
* The character name or role.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("role")
private Optional<String> role;
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the writer.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("thumb")
private Optional<String> thumb;
/**
* A unique key associated with the writers tag, used for internal identification.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("tagKey")
private Optional<String> tagKey;
@JsonCreator
public GetMediaMetaDataWriter(
@JsonProperty("id") long id,
@JsonProperty("filter") String filter,
@JsonProperty("id") int id,
@JsonProperty("tag") String tag,
@JsonProperty("tagKey") String tagKey,
@JsonProperty("role") Optional<String> role,
@JsonProperty("thumb") Optional<String> thumb) {
@JsonProperty("filter") String filter,
@JsonProperty("thumb") Optional<String> thumb,
@JsonProperty("tagKey") Optional<String> tagKey) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(tag, "tag");
Utils.checkNotNull(tagKey, "tagKey");
Utils.checkNotNull(role, "role");
Utils.checkNotNull(filter, "filter");
Utils.checkNotNull(thumb, "thumb");
Utils.checkNotNull(tagKey, "tagKey");
this.id = id;
this.filter = filter;
this.tag = tag;
this.tagKey = tagKey;
this.role = role;
this.filter = filter;
this.thumb = thumb;
this.tagKey = tagKey;
}
public GetMediaMetaDataWriter(
long id,
String filter,
int id,
String tag,
String tagKey) {
this(id, filter, tag, tagKey, Optional.empty(), Optional.empty());
String filter) {
this(id, tag, filter, Optional.empty(), Optional.empty());
}
/**
* The unique role identifier.
* Unique identifier for the writer.
*/
@JsonIgnore
public long id() {
public int id() {
return id;
}
/**
* The filter string for the role.
*/
@JsonIgnore
public String filter() {
return filter;
}
/**
* The actor's name.
* The role of Writer
*/
@JsonIgnore
public String tag() {
@@ -110,53 +92,44 @@ public class GetMediaMetaDataWriter {
}
/**
* A key associated with the actor tag.
* The filter string used to query this writer.
*/
@JsonIgnore
public String tagKey() {
return tagKey;
public String filter() {
return filter;
}
/**
* The character name or role.
*/
@JsonIgnore
public Optional<String> role() {
return role;
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the writer.
*/
@JsonIgnore
public Optional<String> thumb() {
return thumb;
}
/**
* A unique key associated with the writers tag, used for internal identification.
*/
@JsonIgnore
public Optional<String> tagKey() {
return tagKey;
}
public final static Builder builder() {
return new Builder();
}
/**
* The unique role identifier.
* Unique identifier for the writer.
*/
public GetMediaMetaDataWriter withId(long id) {
public GetMediaMetaDataWriter withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The filter string for the role.
*/
public GetMediaMetaDataWriter withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The actor's name.
* The role of Writer
*/
public GetMediaMetaDataWriter withTag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -165,34 +138,16 @@ public class GetMediaMetaDataWriter {
}
/**
* A key associated with the actor tag.
* The filter string used to query this writer.
*/
public GetMediaMetaDataWriter withTagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
public GetMediaMetaDataWriter withFilter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The character name or role.
*/
public GetMediaMetaDataWriter withRole(String role) {
Utils.checkNotNull(role, "role");
this.role = Optional.ofNullable(role);
return this;
}
/**
* The character name or role.
*/
public GetMediaMetaDataWriter withRole(Optional<String> role) {
Utils.checkNotNull(role, "role");
this.role = role;
return this;
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the writer.
*/
public GetMediaMetaDataWriter withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -201,7 +156,7 @@ public class GetMediaMetaDataWriter {
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the writer.
*/
public GetMediaMetaDataWriter withThumb(Optional<String> thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -209,6 +164,24 @@ public class GetMediaMetaDataWriter {
return this;
}
/**
* A unique key associated with the writers tag, used for internal identification.
*/
public GetMediaMetaDataWriter withTagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = Optional.ofNullable(tagKey);
return this;
}
/**
* A unique key associated with the writers tag, used for internal identification.
*/
public GetMediaMetaDataWriter withTagKey(Optional<String> tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
@@ -221,73 +194,59 @@ public class GetMediaMetaDataWriter {
GetMediaMetaDataWriter other = (GetMediaMetaDataWriter) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.tag, other.tag) &&
Objects.deepEquals(this.tagKey, other.tagKey) &&
Objects.deepEquals(this.role, other.role) &&
Objects.deepEquals(this.thumb, other.thumb);
Objects.deepEquals(this.filter, other.filter) &&
Objects.deepEquals(this.thumb, other.thumb) &&
Objects.deepEquals(this.tagKey, other.tagKey);
}
@Override
public int hashCode() {
return Objects.hash(
id,
filter,
tag,
tagKey,
role,
thumb);
filter,
thumb,
tagKey);
}
@Override
public String toString() {
return Utils.toString(GetMediaMetaDataWriter.class,
"id", id,
"filter", filter,
"tag", tag,
"tagKey", tagKey,
"role", role,
"thumb", thumb);
"filter", filter,
"thumb", thumb,
"tagKey", tagKey);
}
public final static class Builder {
private Long id;
private String filter;
private Integer id;
private String tag;
private String tagKey;
private Optional<String> role = Optional.empty();
private String filter;
private Optional<String> thumb = Optional.empty();
private Optional<String> tagKey = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* The unique role identifier.
* Unique identifier for the writer.
*/
public Builder id(long id) {
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The filter string for the role.
*/
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The actor's name.
* The role of Writer
*/
public Builder tag(String tag) {
Utils.checkNotNull(tag, "tag");
@@ -296,34 +255,16 @@ public class GetMediaMetaDataWriter {
}
/**
* A key associated with the actor tag.
* The filter string used to query this writer.
*/
public Builder tagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
public Builder filter(String filter) {
Utils.checkNotNull(filter, "filter");
this.filter = filter;
return this;
}
/**
* The character name or role.
*/
public Builder role(String role) {
Utils.checkNotNull(role, "role");
this.role = Optional.ofNullable(role);
return this;
}
/**
* The character name or role.
*/
public Builder role(Optional<String> role) {
Utils.checkNotNull(role, "role");
this.role = role;
return this;
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the writer.
*/
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
@@ -332,22 +273,39 @@ public class GetMediaMetaDataWriter {
}
/**
* URL for the role thumbnail image.
* The URL of the thumbnail image for the writer.
*/
public Builder thumb(Optional<String> thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
/**
* A unique key associated with the writers tag, used for internal identification.
*/
public Builder tagKey(String tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = Optional.ofNullable(tagKey);
return this;
}
/**
* A unique key associated with the writers tag, used for internal identification.
*/
public Builder tagKey(Optional<String> tagKey) {
Utils.checkNotNull(tagKey, "tagKey");
this.tagKey = tagKey;
return this;
}
public GetMediaMetaDataWriter build() {
return new GetMediaMetaDataWriter(
id,
filter,
tag,
tagKey,
role,
thumb);
filter,
thumb,
tagKey);
}
}
}

View File

@@ -0,0 +1,295 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;
/**
* Marker
*
* <p>The final status of the marker
*/
public class Marker {
@JsonProperty("id")
private long id;
@JsonProperty("type")
private String type;
@JsonProperty("startTimeOffset")
private long startTimeOffset;
@JsonProperty("endTimeOffset")
private long endTimeOffset;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("final")
private Optional<Boolean> final_;
/**
* Attributes associated with the marker.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("Attributes")
private Optional<? extends Attributes> attributes;
@JsonCreator
public Marker(
@JsonProperty("id") long id,
@JsonProperty("type") String type,
@JsonProperty("startTimeOffset") long startTimeOffset,
@JsonProperty("endTimeOffset") long endTimeOffset,
@JsonProperty("final") Optional<Boolean> final_,
@JsonProperty("Attributes") Optional<? extends Attributes> attributes) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(type, "type");
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
Utils.checkNotNull(final_, "final_");
Utils.checkNotNull(attributes, "attributes");
this.id = id;
this.type = type;
this.startTimeOffset = startTimeOffset;
this.endTimeOffset = endTimeOffset;
this.final_ = final_;
this.attributes = attributes;
}
public Marker(
long id,
String type,
long startTimeOffset,
long endTimeOffset) {
this(id, type, startTimeOffset, endTimeOffset, Optional.empty(), Optional.empty());
}
@JsonIgnore
public long id() {
return id;
}
@JsonIgnore
public String type() {
return type;
}
@JsonIgnore
public long startTimeOffset() {
return startTimeOffset;
}
@JsonIgnore
public long endTimeOffset() {
return endTimeOffset;
}
@JsonIgnore
public Optional<Boolean> final_() {
return final_;
}
/**
* Attributes associated with the marker.
*/
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<Attributes> attributes() {
return (Optional<Attributes>) attributes;
}
public final static Builder builder() {
return new Builder();
}
public Marker withId(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public Marker withType(String type) {
Utils.checkNotNull(type, "type");
this.type = type;
return this;
}
public Marker withStartTimeOffset(long startTimeOffset) {
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
this.startTimeOffset = startTimeOffset;
return this;
}
public Marker withEndTimeOffset(long endTimeOffset) {
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
this.endTimeOffset = endTimeOffset;
return this;
}
public Marker withFinal(boolean final_) {
Utils.checkNotNull(final_, "final_");
this.final_ = Optional.ofNullable(final_);
return this;
}
public Marker withFinal(Optional<Boolean> final_) {
Utils.checkNotNull(final_, "final_");
this.final_ = final_;
return this;
}
/**
* Attributes associated with the marker.
*/
public Marker withAttributes(Attributes attributes) {
Utils.checkNotNull(attributes, "attributes");
this.attributes = Optional.ofNullable(attributes);
return this;
}
/**
* Attributes associated with the marker.
*/
public Marker withAttributes(Optional<? extends Attributes> attributes) {
Utils.checkNotNull(attributes, "attributes");
this.attributes = attributes;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Marker other = (Marker) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.type, other.type) &&
Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) &&
Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) &&
Objects.deepEquals(this.final_, other.final_) &&
Objects.deepEquals(this.attributes, other.attributes);
}
@Override
public int hashCode() {
return Objects.hash(
id,
type,
startTimeOffset,
endTimeOffset,
final_,
attributes);
}
@Override
public String toString() {
return Utils.toString(Marker.class,
"id", id,
"type", type,
"startTimeOffset", startTimeOffset,
"endTimeOffset", endTimeOffset,
"final_", final_,
"attributes", attributes);
}
public final static class Builder {
private Long id;
private String type;
private Long startTimeOffset;
private Long endTimeOffset;
private Optional<Boolean> final_ = Optional.empty();
private Optional<? extends Attributes> attributes = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder id(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public Builder type(String type) {
Utils.checkNotNull(type, "type");
this.type = type;
return this;
}
public Builder startTimeOffset(long startTimeOffset) {
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
this.startTimeOffset = startTimeOffset;
return this;
}
public Builder endTimeOffset(long endTimeOffset) {
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
this.endTimeOffset = endTimeOffset;
return this;
}
public Builder final_(boolean final_) {
Utils.checkNotNull(final_, "final_");
this.final_ = Optional.ofNullable(final_);
return this;
}
public Builder final_(Optional<Boolean> final_) {
Utils.checkNotNull(final_, "final_");
this.final_ = final_;
return this;
}
/**
* Attributes associated with the marker.
*/
public Builder attributes(Attributes attributes) {
Utils.checkNotNull(attributes, "attributes");
this.attributes = Optional.ofNullable(attributes);
return this;
}
/**
* Attributes associated with the marker.
*/
public Builder attributes(Optional<? extends Attributes> attributes) {
Utils.checkNotNull(attributes, "attributes");
this.attributes = attributes;
return this;
}
public Marker build() {
return new Marker(
id,
type,
startTimeOffset,
endTimeOffset,
final_,
attributes);
}
}
}

View File

@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
@@ -21,7 +21,7 @@ public class Producer {
* Unique identifier for the producer.
*/
@JsonProperty("id")
private long id;
private int id;
/**
* The filter string used to query this producer.
@@ -51,7 +51,7 @@ public class Producer {
@JsonCreator
public Producer(
@JsonProperty("id") long id,
@JsonProperty("id") int id,
@JsonProperty("filter") String filter,
@JsonProperty("tag") String tag,
@JsonProperty("tagKey") Optional<String> tagKey,
@@ -69,7 +69,7 @@ public class Producer {
}
public Producer(
long id,
int id,
String filter,
String tag) {
this(id, filter, tag, Optional.empty(), Optional.empty());
@@ -79,7 +79,7 @@ public class Producer {
* Unique identifier for the producer.
*/
@JsonIgnore
public long id() {
public int id() {
return id;
}
@@ -122,7 +122,7 @@ public class Producer {
/**
* Unique identifier for the producer.
*/
public Producer withId(long id) {
public Producer withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
@@ -222,7 +222,7 @@ public class Producer {
public final static class Builder {
private Long id;
private Integer id;
private String filter;
@@ -239,7 +239,7 @@ public class Producer {
/**
* Unique identifier for the producer.
*/
public Builder id(long id) {
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;

View File

@@ -27,10 +27,20 @@ public class Stream {
private long id;
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonProperty("streamType")
private int streamType;
private StreamType streamType;
/**
* Format of the stream (e.g., srt).
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("format")
private Optional<String> format;
/**
* Indicates if this stream is default.
@@ -48,8 +58,9 @@ public class Stream {
/**
* Index of the stream.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("index")
private int index;
private Optional<Integer> index;
/**
* Bitrate of the stream.
@@ -216,6 +227,13 @@ public class Stream {
@JsonProperty("frameRate")
private Optional<Float> frameRate;
/**
* Key to access this stream part.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("key")
private Optional<String> key;
/**
* Height of the video stream.
*/
@@ -345,10 +363,11 @@ public class Stream {
@JsonCreator
public Stream(
@JsonProperty("id") long id,
@JsonProperty("streamType") int streamType,
@JsonProperty("streamType") StreamType streamType,
@JsonProperty("format") Optional<String> format,
@JsonProperty("default") Optional<Boolean> default_,
@JsonProperty("codec") String codec,
@JsonProperty("index") int index,
@JsonProperty("index") Optional<Integer> index,
@JsonProperty("bitrate") Optional<Integer> bitrate,
@JsonProperty("language") Optional<String> language,
@JsonProperty("languageTag") Optional<String> languageTag,
@@ -373,6 +392,7 @@ public class Stream {
@JsonProperty("colorSpace") Optional<String> colorSpace,
@JsonProperty("colorTrc") Optional<String> colorTrc,
@JsonProperty("frameRate") Optional<Float> frameRate,
@JsonProperty("key") Optional<String> key,
@JsonProperty("height") Optional<Integer> height,
@JsonProperty("level") Optional<Integer> level,
@JsonProperty("original") Optional<Boolean> original,
@@ -395,6 +415,7 @@ public class Stream {
@JsonProperty("title") Optional<String> title) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(streamType, "streamType");
Utils.checkNotNull(format, "format");
Utils.checkNotNull(default_, "default_");
Utils.checkNotNull(codec, "codec");
Utils.checkNotNull(index, "index");
@@ -422,6 +443,7 @@ public class Stream {
Utils.checkNotNull(colorSpace, "colorSpace");
Utils.checkNotNull(colorTrc, "colorTrc");
Utils.checkNotNull(frameRate, "frameRate");
Utils.checkNotNull(key, "key");
Utils.checkNotNull(height, "height");
Utils.checkNotNull(level, "level");
Utils.checkNotNull(original, "original");
@@ -444,6 +466,7 @@ public class Stream {
Utils.checkNotNull(title, "title");
this.id = id;
this.streamType = streamType;
this.format = format;
this.default_ = default_;
this.codec = codec;
this.index = index;
@@ -471,6 +494,7 @@ public class Stream {
this.colorSpace = colorSpace;
this.colorTrc = colorTrc;
this.frameRate = frameRate;
this.key = key;
this.height = height;
this.level = level;
this.original = original;
@@ -495,12 +519,11 @@ public class Stream {
public Stream(
long id,
int streamType,
StreamType streamType,
String codec,
int index,
String displayTitle,
String extendedDisplayTitle) {
this(id, streamType, Optional.empty(), codec, index, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
this(id, streamType, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -512,13 +535,24 @@ public class Stream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonIgnore
public int streamType() {
public StreamType streamType() {
return streamType;
}
/**
* Format of the stream (e.g., srt).
*/
@JsonIgnore
public Optional<String> format() {
return format;
}
/**
* Indicates if this stream is default.
*/
@@ -539,7 +573,7 @@ public class Stream {
* Index of the stream.
*/
@JsonIgnore
public int index() {
public Optional<Integer> index() {
return index;
}
@@ -732,6 +766,14 @@ public class Stream {
return frameRate;
}
/**
* Key to access this stream part.
*/
@JsonIgnore
public Optional<String> key() {
return key;
}
/**
* Height of the video stream.
*/
@@ -894,14 +936,35 @@ public class Stream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
public Stream withStreamType(int streamType) {
public Stream withStreamType(StreamType streamType) {
Utils.checkNotNull(streamType, "streamType");
this.streamType = streamType;
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Stream withFormat(String format) {
Utils.checkNotNull(format, "format");
this.format = Optional.ofNullable(format);
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Stream withFormat(Optional<String> format) {
Utils.checkNotNull(format, "format");
this.format = format;
return this;
}
/**
* Indicates if this stream is default.
*/
@@ -933,6 +996,15 @@ public class Stream {
* Index of the stream.
*/
public Stream withIndex(int index) {
Utils.checkNotNull(index, "index");
this.index = Optional.ofNullable(index);
return this;
}
/**
* Index of the stream.
*/
public Stream withIndex(Optional<Integer> index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
@@ -1364,6 +1436,24 @@ public class Stream {
return this;
}
/**
* Key to access this stream part.
*/
public Stream withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = Optional.ofNullable(key);
return this;
}
/**
* Key to access this stream part.
*/
public Stream withKey(Optional<String> key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* Height of the video stream.
*/
@@ -1695,6 +1785,7 @@ public class Stream {
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.streamType, other.streamType) &&
Objects.deepEquals(this.format, other.format) &&
Objects.deepEquals(this.default_, other.default_) &&
Objects.deepEquals(this.codec, other.codec) &&
Objects.deepEquals(this.index, other.index) &&
@@ -1722,6 +1813,7 @@ public class Stream {
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
Objects.deepEquals(this.frameRate, other.frameRate) &&
Objects.deepEquals(this.key, other.key) &&
Objects.deepEquals(this.height, other.height) &&
Objects.deepEquals(this.level, other.level) &&
Objects.deepEquals(this.original, other.original) &&
@@ -1749,6 +1841,7 @@ public class Stream {
return Objects.hash(
id,
streamType,
format,
default_,
codec,
index,
@@ -1776,6 +1869,7 @@ public class Stream {
colorSpace,
colorTrc,
frameRate,
key,
height,
level,
original,
@@ -1803,6 +1897,7 @@ public class Stream {
return Utils.toString(Stream.class,
"id", id,
"streamType", streamType,
"format", format,
"default_", default_,
"codec", codec,
"index", index,
@@ -1830,6 +1925,7 @@ public class Stream {
"colorSpace", colorSpace,
"colorTrc", colorTrc,
"frameRate", frameRate,
"key", key,
"height", height,
"level", level,
"original", original,
@@ -1856,13 +1952,15 @@ public class Stream {
private Long id;
private Integer streamType;
private StreamType streamType;
private Optional<String> format = Optional.empty();
private Optional<Boolean> default_ = Optional.empty();
private String codec;
private Integer index;
private Optional<Integer> index = Optional.empty();
private Optional<Integer> bitrate = Optional.empty();
@@ -1912,6 +2010,8 @@ public class Stream {
private Optional<Float> frameRate = Optional.empty();
private Optional<String> key = Optional.empty();
private Optional<Integer> height = Optional.empty();
private Optional<Integer> level = Optional.empty();
@@ -1966,14 +2066,35 @@ public class Stream {
}
/**
* Stream type (1=video, 2=audio, 3=subtitle).
* Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
public Builder streamType(int streamType) {
public Builder streamType(StreamType streamType) {
Utils.checkNotNull(streamType, "streamType");
this.streamType = streamType;
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Builder format(String format) {
Utils.checkNotNull(format, "format");
this.format = Optional.ofNullable(format);
return this;
}
/**
* Format of the stream (e.g., srt).
*/
public Builder format(Optional<String> format) {
Utils.checkNotNull(format, "format");
this.format = format;
return this;
}
/**
* Indicates if this stream is default.
*/
@@ -2005,6 +2126,15 @@ public class Stream {
* Index of the stream.
*/
public Builder index(int index) {
Utils.checkNotNull(index, "index");
this.index = Optional.ofNullable(index);
return this;
}
/**
* Index of the stream.
*/
public Builder index(Optional<Integer> index) {
Utils.checkNotNull(index, "index");
this.index = index;
return this;
@@ -2436,6 +2566,24 @@ public class Stream {
return this;
}
/**
* Key to access this stream part.
*/
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = Optional.ofNullable(key);
return this;
}
/**
* Key to access this stream part.
*/
public Builder key(Optional<String> key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* Height of the video stream.
*/
@@ -2758,6 +2906,7 @@ public class Stream {
return new Stream(
id,
streamType,
format,
default_,
codec,
index,
@@ -2785,6 +2934,7 @@ public class Stream {
colorSpace,
colorTrc,
frameRate,
key,
height,
level,
original,

View File

@@ -0,0 +1,192 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
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.Integer;
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).
*
*/
/**
* StreamType
*
* <p>Stream type:
* - 1 = video
* - 2 = audio
* - 3 = subtitle
*/
@JsonDeserialize(using = StreamType._Deserializer.class)
@JsonSerialize(using = StreamType._Serializer.class)
public class StreamType {
public static final StreamType Video = new StreamType(1);
public static final StreamType Audio = new StreamType(2);
public static final StreamType Subtitle = new StreamType(3);
// 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<Integer, StreamType> values = createValuesMap();
private static final Map<Integer, StreamTypeEnum> enums = createEnumsMap();
private final int value;
private StreamType(int value) {
this.value = value;
}
/**
* Returns a StreamType 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 StreamType
*/
public static StreamType of(int value) {
synchronized (StreamType.class) {
return values.computeIfAbsent(value, v -> new StreamType(v));
}
}
public int value() {
return value;
}
public Optional<StreamTypeEnum> 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;
StreamType other = (StreamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "StreamType [value=" + value + "]";
}
// return an array just like an enum
public static StreamType[] values() {
synchronized (StreamType.class) {
return values.values().toArray(new StreamType[] {});
}
}
private static final Map<Integer, StreamType> createValuesMap() {
Map<Integer, StreamType> map = new LinkedHashMap<>();
map.put(1, Video);
map.put(2, Audio);
map.put(3, Subtitle);
return map;
}
private static final Map<Integer, StreamTypeEnum> createEnumsMap() {
Map<Integer, StreamTypeEnum> map = new HashMap<>();
map.put(1, StreamTypeEnum.Video);
map.put(2, StreamTypeEnum.Audio);
map.put(3, StreamTypeEnum.Subtitle);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<StreamType> {
protected _Serializer() {
super(StreamType.class);
}
@Override
public void serialize(StreamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<StreamType> {
protected _Deserializer() {
super(StreamType.class);
}
@Override
public StreamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
int v = p.readValueAs(new TypeReference<Integer>() {});
// use the factory method to ensure we get singletons
return StreamType.of(v);
}
}
public enum StreamTypeEnum {
Video(1),
Audio(2),
Subtitle(3),;
private final int value;
private StreamTypeEnum(int value) {
this.value = value;
}
public int value() {
return value;
}
}
}

View File

@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
@@ -21,7 +21,7 @@ public class Writer {
* Unique identifier for the writer.
*/
@JsonProperty("id")
private long id;
private int id;
/**
* The filter string used to query this writer.
@@ -44,7 +44,7 @@ public class Writer {
@JsonCreator
public Writer(
@JsonProperty("id") long id,
@JsonProperty("id") int id,
@JsonProperty("filter") String filter,
@JsonProperty("tag") String tag,
@JsonProperty("tagKey") Optional<String> tagKey) {
@@ -59,7 +59,7 @@ public class Writer {
}
public Writer(
long id,
int id,
String filter,
String tag) {
this(id, filter, tag, Optional.empty());
@@ -69,7 +69,7 @@ public class Writer {
* Unique identifier for the writer.
*/
@JsonIgnore
public long id() {
public int id() {
return id;
}
@@ -104,7 +104,7 @@ public class Writer {
/**
* Unique identifier for the writer.
*/
public Writer withId(long id) {
public Writer withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
@@ -183,7 +183,7 @@ public class Writer {
public final static class Builder {
private Long id;
private Integer id;
private String filter;
@@ -198,7 +198,7 @@ public class Writer {
/**
* Unique identifier for the writer.
*/
public Builder id(long id) {
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;