/* * 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 com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Double; import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; import java.util.Objects; import java.util.Optional; public class GetLibraryItemsMedia { @JsonProperty("id") private int id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") private Optional width; @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") private Optional height; @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") private Optional aspectRatio; @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") private Optional videoCodec; @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") private Optional videoResolution; @JsonProperty("container") private String container; @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") private Optional videoFrameRate; @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasVoiceActivity") private Optional hasVoiceActivity; @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @JsonProperty("Part") private List part; @JsonCreator public GetLibraryItemsMedia( @JsonProperty("id") int id, @JsonProperty("duration") Optional duration, @JsonProperty("bitrate") Optional bitrate, @JsonProperty("width") Optional width, @JsonProperty("height") Optional height, @JsonProperty("aspectRatio") Optional aspectRatio, @JsonProperty("audioProfile") Optional audioProfile, @JsonProperty("audioChannels") Optional audioChannels, @JsonProperty("audioCodec") Optional audioCodec, @JsonProperty("videoCodec") Optional videoCodec, @JsonProperty("videoResolution") Optional videoResolution, @JsonProperty("container") String container, @JsonProperty("videoFrameRate") Optional videoFrameRate, @JsonProperty("videoProfile") Optional videoProfile, @JsonProperty("hasVoiceActivity") Optional hasVoiceActivity, @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, @JsonProperty("has64bitOffsets") Optional has64bitOffsets, @JsonProperty("Part") List part) { Utils.checkNotNull(id, "id"); Utils.checkNotNull(duration, "duration"); Utils.checkNotNull(bitrate, "bitrate"); Utils.checkNotNull(width, "width"); Utils.checkNotNull(height, "height"); Utils.checkNotNull(aspectRatio, "aspectRatio"); Utils.checkNotNull(audioProfile, "audioProfile"); Utils.checkNotNull(audioChannels, "audioChannels"); Utils.checkNotNull(audioCodec, "audioCodec"); Utils.checkNotNull(videoCodec, "videoCodec"); Utils.checkNotNull(videoResolution, "videoResolution"); Utils.checkNotNull(container, "container"); Utils.checkNotNull(videoFrameRate, "videoFrameRate"); Utils.checkNotNull(videoProfile, "videoProfile"); Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); Utils.checkNotNull(part, "part"); this.id = id; this.duration = duration; this.bitrate = bitrate; this.width = width; this.height = height; this.aspectRatio = aspectRatio; this.audioProfile = audioProfile; this.audioChannels = audioChannels; this.audioCodec = audioCodec; this.videoCodec = videoCodec; this.videoResolution = videoResolution; this.container = container; this.videoFrameRate = videoFrameRate; this.videoProfile = videoProfile; this.hasVoiceActivity = hasVoiceActivity; this.optimizedForStreaming = optimizedForStreaming; this.has64bitOffsets = has64bitOffsets; this.part = part; } public GetLibraryItemsMedia( int id, String container, List part) { this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), part); } @JsonIgnore public int id() { return id; } @JsonIgnore public Optional duration() { return duration; } @JsonIgnore public Optional bitrate() { return bitrate; } @JsonIgnore public Optional width() { return width; } @JsonIgnore public Optional height() { return height; } @JsonIgnore public Optional aspectRatio() { return aspectRatio; } @JsonIgnore public Optional audioProfile() { return audioProfile; } @JsonIgnore public Optional audioChannels() { return audioChannels; } @JsonIgnore public Optional audioCodec() { return audioCodec; } @JsonIgnore public Optional videoCodec() { return videoCodec; } @JsonIgnore public Optional videoResolution() { return videoResolution; } @JsonIgnore public String container() { return container; } @JsonIgnore public Optional videoFrameRate() { return videoFrameRate; } @JsonIgnore public Optional videoProfile() { return videoProfile; } @JsonIgnore public Optional hasVoiceActivity() { return hasVoiceActivity; } @SuppressWarnings("unchecked") @JsonIgnore public Optional optimizedForStreaming() { return (Optional) optimizedForStreaming; } @JsonIgnore public Optional has64bitOffsets() { return has64bitOffsets; } @JsonIgnore public List part() { return part; } public final static Builder builder() { return new Builder(); } public GetLibraryItemsMedia withId(int id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } public GetLibraryItemsMedia withDuration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); return this; } public GetLibraryItemsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } public GetLibraryItemsMedia withBitrate(int bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); return this; } public GetLibraryItemsMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; return this; } public GetLibraryItemsMedia withWidth(int width) { Utils.checkNotNull(width, "width"); this.width = Optional.ofNullable(width); return this; } public GetLibraryItemsMedia withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } public GetLibraryItemsMedia withHeight(int height) { Utils.checkNotNull(height, "height"); this.height = Optional.ofNullable(height); return this; } public GetLibraryItemsMedia withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } public GetLibraryItemsMedia withAspectRatio(double aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = Optional.ofNullable(aspectRatio); return this; } public GetLibraryItemsMedia withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; return this; } public GetLibraryItemsMedia withAudioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); return this; } public GetLibraryItemsMedia withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; return this; } public GetLibraryItemsMedia withAudioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); return this; } public GetLibraryItemsMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; return this; } public GetLibraryItemsMedia withAudioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); return this; } public GetLibraryItemsMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; return this; } public GetLibraryItemsMedia withVideoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); return this; } public GetLibraryItemsMedia withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; return this; } public GetLibraryItemsMedia withVideoResolution(String videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = Optional.ofNullable(videoResolution); return this; } public GetLibraryItemsMedia withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; return this; } public GetLibraryItemsMedia withContainer(String container) { Utils.checkNotNull(container, "container"); this.container = container; return this; } public GetLibraryItemsMedia withVideoFrameRate(String videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = Optional.ofNullable(videoFrameRate); return this; } public GetLibraryItemsMedia withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; return this; } public GetLibraryItemsMedia withVideoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); return this; } public GetLibraryItemsMedia withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; } public GetLibraryItemsMedia withHasVoiceActivity(boolean hasVoiceActivity) { Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); this.hasVoiceActivity = Optional.ofNullable(hasVoiceActivity); return this; } public GetLibraryItemsMedia withHasVoiceActivity(Optional hasVoiceActivity) { Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); this.hasVoiceActivity = hasVoiceActivity; return this; } public GetLibraryItemsMedia withOptimizedForStreaming(GetLibraryItemsOptimizedForStreaming optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); return this; } public GetLibraryItemsMedia withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; return this; } public GetLibraryItemsMedia withHas64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); return this; } public GetLibraryItemsMedia withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; return this; } public GetLibraryItemsMedia withPart(List part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GetLibraryItemsMedia other = (GetLibraryItemsMedia) o; return Objects.deepEquals(this.id, other.id) && Objects.deepEquals(this.duration, other.duration) && Objects.deepEquals(this.bitrate, other.bitrate) && Objects.deepEquals(this.width, other.width) && Objects.deepEquals(this.height, other.height) && Objects.deepEquals(this.aspectRatio, other.aspectRatio) && Objects.deepEquals(this.audioProfile, other.audioProfile) && Objects.deepEquals(this.audioChannels, other.audioChannels) && Objects.deepEquals(this.audioCodec, other.audioCodec) && Objects.deepEquals(this.videoCodec, other.videoCodec) && Objects.deepEquals(this.videoResolution, other.videoResolution) && Objects.deepEquals(this.container, other.container) && Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && Objects.deepEquals(this.videoProfile, other.videoProfile) && Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && Objects.deepEquals(this.part, other.part); } @Override public int hashCode() { return Objects.hash( id, duration, bitrate, width, height, aspectRatio, audioProfile, audioChannels, audioCodec, videoCodec, videoResolution, container, videoFrameRate, videoProfile, hasVoiceActivity, optimizedForStreaming, has64bitOffsets, part); } @Override public String toString() { return Utils.toString(GetLibraryItemsMedia.class, "id", id, "duration", duration, "bitrate", bitrate, "width", width, "height", height, "aspectRatio", aspectRatio, "audioProfile", audioProfile, "audioChannels", audioChannels, "audioCodec", audioCodec, "videoCodec", videoCodec, "videoResolution", videoResolution, "container", container, "videoFrameRate", videoFrameRate, "videoProfile", videoProfile, "hasVoiceActivity", hasVoiceActivity, "optimizedForStreaming", optimizedForStreaming, "has64bitOffsets", has64bitOffsets, "part", part); } public final static class Builder { private Integer id; private Optional duration = Optional.empty(); private Optional bitrate = Optional.empty(); private Optional width = Optional.empty(); private Optional height = Optional.empty(); private Optional aspectRatio = Optional.empty(); private Optional audioProfile = Optional.empty(); private Optional audioChannels = Optional.empty(); private Optional audioCodec = Optional.empty(); private Optional videoCodec = Optional.empty(); private Optional videoResolution = Optional.empty(); private String container; private Optional videoFrameRate = Optional.empty(); private Optional videoProfile = Optional.empty(); private Optional hasVoiceActivity = Optional.empty(); private Optional optimizedForStreaming; private Optional has64bitOffsets = Optional.empty(); private List part; private Builder() { // force use of static builder() method } public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); return this; } public Builder duration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } public Builder bitrate(int bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); return this; } public Builder bitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; return this; } public Builder width(int width) { Utils.checkNotNull(width, "width"); this.width = Optional.ofNullable(width); return this; } public Builder width(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } public Builder height(int height) { Utils.checkNotNull(height, "height"); this.height = Optional.ofNullable(height); return this; } public Builder height(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } public Builder aspectRatio(double aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = Optional.ofNullable(aspectRatio); return this; } public Builder aspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; return this; } public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); return this; } public Builder audioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; return this; } public Builder audioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); return this; } public Builder audioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; return this; } public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); return this; } public Builder audioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; return this; } public Builder videoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); return this; } public Builder videoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; return this; } public Builder videoResolution(String videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = Optional.ofNullable(videoResolution); return this; } public Builder videoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; return this; } public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = container; return this; } public Builder videoFrameRate(String videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = Optional.ofNullable(videoFrameRate); return this; } public Builder videoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; return this; } public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); return this; } public Builder videoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; } public Builder hasVoiceActivity(boolean hasVoiceActivity) { Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); this.hasVoiceActivity = Optional.ofNullable(hasVoiceActivity); return this; } public Builder hasVoiceActivity(Optional hasVoiceActivity) { Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); this.hasVoiceActivity = hasVoiceActivity; return this; } public Builder optimizedForStreaming(GetLibraryItemsOptimizedForStreaming optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); return this; } public Builder optimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; return this; } public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); return this; } public Builder has64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; return this; } public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } public GetLibraryItemsMedia build() { if (optimizedForStreaming == null) { optimizedForStreaming = _SINGLETON_VALUE_OptimizedForStreaming.value(); } return new GetLibraryItemsMedia( id, duration, bitrate, width, height, aspectRatio, audioProfile, audioChannels, audioCodec, videoCodec, videoResolution, container, videoFrameRate, videoProfile, hasVoiceActivity, optimizedForStreaming, has64bitOffsets, part); } private static final LazySingletonValue> _SINGLETON_VALUE_OptimizedForStreaming = new LazySingletonValue<>( "optimizedForStreaming", "0", new TypeReference>() {}); } }