/* 
 * 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.Float;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;


public class GetAllMediaLibraryStream {

    /**
     * Unique stream identifier.
     */
    @JsonProperty("id")
    private long id;

    /**
     * Stream type (1=video, 2=audio, 3=subtitle).
     */
    @JsonProperty("streamType")
    private int streamType;

    /**
     * Indicates if this stream is default.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("default")
    private Optional<Boolean> default_;

    /**
     * Codec used by the stream.
     */
    @JsonProperty("codec")
    private String codec;

    /**
     * Index of the stream.
     */
    @JsonProperty("index")
    private int index;

    /**
     * Bitrate of the stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("bitrate")
    private Optional<Integer> bitrate;

    /**
     * Language of the stream.
     */
    @JsonProperty("language")
    private String language;

    /**
     * Language tag (e.g., en).
     */
    @JsonProperty("languageTag")
    private String languageTag;

    /**
     * ISO language code.
     */
    @JsonProperty("languageCode")
    private String languageCode;

    /**
     * Indicates whether header compression is enabled.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("headerCompression")
    private Optional<Boolean> headerCompression;

    /**
     * Dolby Vision BL compatibility ID.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIBLCompatID")
    private Optional<Integer> doviblCompatID;

    /**
     * Indicates if Dolby Vision BL is present.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIBLPresent")
    private Optional<Boolean> doviblPresent;

    /**
     * Indicates if Dolby Vision EL is present.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIELPresent")
    private Optional<Boolean> dovielPresent;

    /**
     * Dolby Vision level.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVILevel")
    private Optional<Integer> doviLevel;

    /**
     * Indicates if Dolby Vision is present.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIPresent")
    private Optional<Boolean> doviPresent;

    /**
     * Dolby Vision profile.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIProfile")
    private Optional<Integer> doviProfile;

    /**
     * Indicates if Dolby Vision RPU is present.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIRPUPresent")
    private Optional<Boolean> dovirpuPresent;

    /**
     * Dolby Vision version.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("DOVIVersion")
    private Optional<String> doviVersion;

    /**
     * Bit depth of the video stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("bitDepth")
    private Optional<Integer> bitDepth;

    /**
     * Chroma sample location.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("chromaLocation")
    private Optional<String> chromaLocation;

    /**
     * Chroma subsampling format.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("chromaSubsampling")
    private Optional<String> chromaSubsampling;

    /**
     * Coded video height.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("codedHeight")
    private Optional<Integer> codedHeight;

    /**
     * Coded video width.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("codedWidth")
    private Optional<Integer> codedWidth;

    /**
     * Color primaries used.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("colorPrimaries")
    private Optional<String> colorPrimaries;

    /**
     * Color range (e.g., tv).
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("colorRange")
    private Optional<String> colorRange;

    /**
     * Color space.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("colorSpace")
    private Optional<String> colorSpace;

    /**
     * Color transfer characteristics.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("colorTrc")
    private Optional<String> colorTrc;

    /**
     * Frame rate of the stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("frameRate")
    private Optional<Float> frameRate;

    /**
     * Height of the video stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("height")
    private Optional<Integer> height;

    /**
     * Video level.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("level")
    private Optional<Integer> level;

    /**
     * Indicates if this is the original stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("original")
    private Optional<Boolean> original;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("hasScalingMatrix")
    private Optional<Boolean> hasScalingMatrix;

    /**
     * Video profile.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("profile")
    private Optional<String> profile;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("scanType")
    private Optional<String> scanType;

    /**
     * Number of reference frames.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("refFrames")
    private Optional<Integer> refFrames;

    /**
     * Width of the video stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("width")
    private Optional<Integer> width;

    /**
     * Display title for the stream.
     */
    @JsonProperty("displayTitle")
    private String displayTitle;

    /**
     * Extended display title for the stream.
     */
    @JsonProperty("extendedDisplayTitle")
    private String extendedDisplayTitle;

    /**
     * Indicates if this stream is selected (applicable for audio streams).
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("selected")
    private Optional<Boolean> selected;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("forced")
    private Optional<Boolean> forced;

    /**
     * Number of audio channels (for audio streams).
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("channels")
    private Optional<Integer> channels;

    /**
     * Audio channel layout.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("audioChannelLayout")
    private Optional<String> audioChannelLayout;

    /**
     * Sampling rate for the audio stream.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("samplingRate")
    private Optional<Integer> samplingRate;

    /**
     * Indicates if the stream can auto-sync.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("canAutoSync")
    private Optional<Boolean> canAutoSync;

    /**
     * Indicates if the stream is for the hearing impaired.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("hearingImpaired")
    private Optional<Boolean> hearingImpaired;

    /**
     * Indicates if the stream is a dub.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("dub")
    private Optional<Boolean> dub;

    /**
     * Optional title for the stream (e.g., language variant).
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("title")
    private Optional<String> title;

    @JsonCreator
    public GetAllMediaLibraryStream(
            @JsonProperty("id") long id,
            @JsonProperty("streamType") int streamType,
            @JsonProperty("default") Optional<Boolean> default_,
            @JsonProperty("codec") String codec,
            @JsonProperty("index") int index,
            @JsonProperty("bitrate") Optional<Integer> bitrate,
            @JsonProperty("language") String language,
            @JsonProperty("languageTag") String languageTag,
            @JsonProperty("languageCode") String languageCode,
            @JsonProperty("headerCompression") Optional<Boolean> headerCompression,
            @JsonProperty("DOVIBLCompatID") Optional<Integer> doviblCompatID,
            @JsonProperty("DOVIBLPresent") Optional<Boolean> doviblPresent,
            @JsonProperty("DOVIELPresent") Optional<Boolean> dovielPresent,
            @JsonProperty("DOVILevel") Optional<Integer> doviLevel,
            @JsonProperty("DOVIPresent") Optional<Boolean> doviPresent,
            @JsonProperty("DOVIProfile") Optional<Integer> doviProfile,
            @JsonProperty("DOVIRPUPresent") Optional<Boolean> dovirpuPresent,
            @JsonProperty("DOVIVersion") Optional<String> doviVersion,
            @JsonProperty("bitDepth") Optional<Integer> bitDepth,
            @JsonProperty("chromaLocation") Optional<String> chromaLocation,
            @JsonProperty("chromaSubsampling") Optional<String> chromaSubsampling,
            @JsonProperty("codedHeight") Optional<Integer> codedHeight,
            @JsonProperty("codedWidth") Optional<Integer> codedWidth,
            @JsonProperty("colorPrimaries") Optional<String> colorPrimaries,
            @JsonProperty("colorRange") Optional<String> colorRange,
            @JsonProperty("colorSpace") Optional<String> colorSpace,
            @JsonProperty("colorTrc") Optional<String> colorTrc,
            @JsonProperty("frameRate") Optional<Float> frameRate,
            @JsonProperty("height") Optional<Integer> height,
            @JsonProperty("level") Optional<Integer> level,
            @JsonProperty("original") Optional<Boolean> original,
            @JsonProperty("hasScalingMatrix") Optional<Boolean> hasScalingMatrix,
            @JsonProperty("profile") Optional<String> profile,
            @JsonProperty("scanType") Optional<String> scanType,
            @JsonProperty("refFrames") Optional<Integer> refFrames,
            @JsonProperty("width") Optional<Integer> width,
            @JsonProperty("displayTitle") String displayTitle,
            @JsonProperty("extendedDisplayTitle") String extendedDisplayTitle,
            @JsonProperty("selected") Optional<Boolean> selected,
            @JsonProperty("forced") Optional<Boolean> forced,
            @JsonProperty("channels") Optional<Integer> channels,
            @JsonProperty("audioChannelLayout") Optional<String> audioChannelLayout,
            @JsonProperty("samplingRate") Optional<Integer> samplingRate,
            @JsonProperty("canAutoSync") Optional<Boolean> canAutoSync,
            @JsonProperty("hearingImpaired") Optional<Boolean> hearingImpaired,
            @JsonProperty("dub") Optional<Boolean> dub,
            @JsonProperty("title") Optional<String> title) {
        Utils.checkNotNull(id, "id");
        Utils.checkNotNull(streamType, "streamType");
        Utils.checkNotNull(default_, "default_");
        Utils.checkNotNull(codec, "codec");
        Utils.checkNotNull(index, "index");
        Utils.checkNotNull(bitrate, "bitrate");
        Utils.checkNotNull(language, "language");
        Utils.checkNotNull(languageTag, "languageTag");
        Utils.checkNotNull(languageCode, "languageCode");
        Utils.checkNotNull(headerCompression, "headerCompression");
        Utils.checkNotNull(doviblCompatID, "doviblCompatID");
        Utils.checkNotNull(doviblPresent, "doviblPresent");
        Utils.checkNotNull(dovielPresent, "dovielPresent");
        Utils.checkNotNull(doviLevel, "doviLevel");
        Utils.checkNotNull(doviPresent, "doviPresent");
        Utils.checkNotNull(doviProfile, "doviProfile");
        Utils.checkNotNull(dovirpuPresent, "dovirpuPresent");
        Utils.checkNotNull(doviVersion, "doviVersion");
        Utils.checkNotNull(bitDepth, "bitDepth");
        Utils.checkNotNull(chromaLocation, "chromaLocation");
        Utils.checkNotNull(chromaSubsampling, "chromaSubsampling");
        Utils.checkNotNull(codedHeight, "codedHeight");
        Utils.checkNotNull(codedWidth, "codedWidth");
        Utils.checkNotNull(colorPrimaries, "colorPrimaries");
        Utils.checkNotNull(colorRange, "colorRange");
        Utils.checkNotNull(colorSpace, "colorSpace");
        Utils.checkNotNull(colorTrc, "colorTrc");
        Utils.checkNotNull(frameRate, "frameRate");
        Utils.checkNotNull(height, "height");
        Utils.checkNotNull(level, "level");
        Utils.checkNotNull(original, "original");
        Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix");
        Utils.checkNotNull(profile, "profile");
        Utils.checkNotNull(scanType, "scanType");
        Utils.checkNotNull(refFrames, "refFrames");
        Utils.checkNotNull(width, "width");
        Utils.checkNotNull(displayTitle, "displayTitle");
        Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle");
        Utils.checkNotNull(selected, "selected");
        Utils.checkNotNull(forced, "forced");
        Utils.checkNotNull(channels, "channels");
        Utils.checkNotNull(audioChannelLayout, "audioChannelLayout");
        Utils.checkNotNull(samplingRate, "samplingRate");
        Utils.checkNotNull(canAutoSync, "canAutoSync");
        Utils.checkNotNull(hearingImpaired, "hearingImpaired");
        Utils.checkNotNull(dub, "dub");
        Utils.checkNotNull(title, "title");
        this.id = id;
        this.streamType = streamType;
        this.default_ = default_;
        this.codec = codec;
        this.index = index;
        this.bitrate = bitrate;
        this.language = language;
        this.languageTag = languageTag;
        this.languageCode = languageCode;
        this.headerCompression = headerCompression;
        this.doviblCompatID = doviblCompatID;
        this.doviblPresent = doviblPresent;
        this.dovielPresent = dovielPresent;
        this.doviLevel = doviLevel;
        this.doviPresent = doviPresent;
        this.doviProfile = doviProfile;
        this.dovirpuPresent = dovirpuPresent;
        this.doviVersion = doviVersion;
        this.bitDepth = bitDepth;
        this.chromaLocation = chromaLocation;
        this.chromaSubsampling = chromaSubsampling;
        this.codedHeight = codedHeight;
        this.codedWidth = codedWidth;
        this.colorPrimaries = colorPrimaries;
        this.colorRange = colorRange;
        this.colorSpace = colorSpace;
        this.colorTrc = colorTrc;
        this.frameRate = frameRate;
        this.height = height;
        this.level = level;
        this.original = original;
        this.hasScalingMatrix = hasScalingMatrix;
        this.profile = profile;
        this.scanType = scanType;
        this.refFrames = refFrames;
        this.width = width;
        this.displayTitle = displayTitle;
        this.extendedDisplayTitle = extendedDisplayTitle;
        this.selected = selected;
        this.forced = forced;
        this.channels = channels;
        this.audioChannelLayout = audioChannelLayout;
        this.samplingRate = samplingRate;
        this.canAutoSync = canAutoSync;
        this.hearingImpaired = hearingImpaired;
        this.dub = dub;
        this.title = title;
    }
    
    public GetAllMediaLibraryStream(
            long id,
            int streamType,
            String codec,
            int index,
            String language,
            String languageTag,
            String languageCode,
            String displayTitle,
            String extendedDisplayTitle) {
        this(id, streamType, Optional.empty(), codec, index, Optional.empty(), language, languageTag, languageCode, 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());
    }

    /**
     * Unique stream identifier.
     */
    @JsonIgnore
    public long id() {
        return id;
    }

    /**
     * Stream type (1=video, 2=audio, 3=subtitle).
     */
    @JsonIgnore
    public int streamType() {
        return streamType;
    }

    /**
     * Indicates if this stream is default.
     */
    @JsonIgnore
    public Optional<Boolean> default_() {
        return default_;
    }

    /**
     * Codec used by the stream.
     */
    @JsonIgnore
    public String codec() {
        return codec;
    }

    /**
     * Index of the stream.
     */
    @JsonIgnore
    public int index() {
        return index;
    }

    /**
     * Bitrate of the stream.
     */
    @JsonIgnore
    public Optional<Integer> bitrate() {
        return bitrate;
    }

    /**
     * Language of the stream.
     */
    @JsonIgnore
    public String language() {
        return language;
    }

    /**
     * Language tag (e.g., en).
     */
    @JsonIgnore
    public String languageTag() {
        return languageTag;
    }

    /**
     * ISO language code.
     */
    @JsonIgnore
    public String languageCode() {
        return languageCode;
    }

    /**
     * Indicates whether header compression is enabled.
     */
    @JsonIgnore
    public Optional<Boolean> headerCompression() {
        return headerCompression;
    }

    /**
     * Dolby Vision BL compatibility ID.
     */
    @JsonIgnore
    public Optional<Integer> doviblCompatID() {
        return doviblCompatID;
    }

    /**
     * Indicates if Dolby Vision BL is present.
     */
    @JsonIgnore
    public Optional<Boolean> doviblPresent() {
        return doviblPresent;
    }

    /**
     * Indicates if Dolby Vision EL is present.
     */
    @JsonIgnore
    public Optional<Boolean> dovielPresent() {
        return dovielPresent;
    }

    /**
     * Dolby Vision level.
     */
    @JsonIgnore
    public Optional<Integer> doviLevel() {
        return doviLevel;
    }

    /**
     * Indicates if Dolby Vision is present.
     */
    @JsonIgnore
    public Optional<Boolean> doviPresent() {
        return doviPresent;
    }

    /**
     * Dolby Vision profile.
     */
    @JsonIgnore
    public Optional<Integer> doviProfile() {
        return doviProfile;
    }

    /**
     * Indicates if Dolby Vision RPU is present.
     */
    @JsonIgnore
    public Optional<Boolean> dovirpuPresent() {
        return dovirpuPresent;
    }

    /**
     * Dolby Vision version.
     */
    @JsonIgnore
    public Optional<String> doviVersion() {
        return doviVersion;
    }

    /**
     * Bit depth of the video stream.
     */
    @JsonIgnore
    public Optional<Integer> bitDepth() {
        return bitDepth;
    }

    /**
     * Chroma sample location.
     */
    @JsonIgnore
    public Optional<String> chromaLocation() {
        return chromaLocation;
    }

    /**
     * Chroma subsampling format.
     */
    @JsonIgnore
    public Optional<String> chromaSubsampling() {
        return chromaSubsampling;
    }

    /**
     * Coded video height.
     */
    @JsonIgnore
    public Optional<Integer> codedHeight() {
        return codedHeight;
    }

    /**
     * Coded video width.
     */
    @JsonIgnore
    public Optional<Integer> codedWidth() {
        return codedWidth;
    }

    /**
     * Color primaries used.
     */
    @JsonIgnore
    public Optional<String> colorPrimaries() {
        return colorPrimaries;
    }

    /**
     * Color range (e.g., tv).
     */
    @JsonIgnore
    public Optional<String> colorRange() {
        return colorRange;
    }

    /**
     * Color space.
     */
    @JsonIgnore
    public Optional<String> colorSpace() {
        return colorSpace;
    }

    /**
     * Color transfer characteristics.
     */
    @JsonIgnore
    public Optional<String> colorTrc() {
        return colorTrc;
    }

    /**
     * Frame rate of the stream.
     */
    @JsonIgnore
    public Optional<Float> frameRate() {
        return frameRate;
    }

    /**
     * Height of the video stream.
     */
    @JsonIgnore
    public Optional<Integer> height() {
        return height;
    }

    /**
     * Video level.
     */
    @JsonIgnore
    public Optional<Integer> level() {
        return level;
    }

    /**
     * Indicates if this is the original stream.
     */
    @JsonIgnore
    public Optional<Boolean> original() {
        return original;
    }

    @JsonIgnore
    public Optional<Boolean> hasScalingMatrix() {
        return hasScalingMatrix;
    }

    /**
     * Video profile.
     */
    @JsonIgnore
    public Optional<String> profile() {
        return profile;
    }

    @JsonIgnore
    public Optional<String> scanType() {
        return scanType;
    }

    /**
     * Number of reference frames.
     */
    @JsonIgnore
    public Optional<Integer> refFrames() {
        return refFrames;
    }

    /**
     * Width of the video stream.
     */
    @JsonIgnore
    public Optional<Integer> width() {
        return width;
    }

    /**
     * Display title for the stream.
     */
    @JsonIgnore
    public String displayTitle() {
        return displayTitle;
    }

    /**
     * Extended display title for the stream.
     */
    @JsonIgnore
    public String extendedDisplayTitle() {
        return extendedDisplayTitle;
    }

    /**
     * Indicates if this stream is selected (applicable for audio streams).
     */
    @JsonIgnore
    public Optional<Boolean> selected() {
        return selected;
    }

    @JsonIgnore
    public Optional<Boolean> forced() {
        return forced;
    }

    /**
     * Number of audio channels (for audio streams).
     */
    @JsonIgnore
    public Optional<Integer> channels() {
        return channels;
    }

    /**
     * Audio channel layout.
     */
    @JsonIgnore
    public Optional<String> audioChannelLayout() {
        return audioChannelLayout;
    }

    /**
     * Sampling rate for the audio stream.
     */
    @JsonIgnore
    public Optional<Integer> samplingRate() {
        return samplingRate;
    }

    /**
     * Indicates if the stream can auto-sync.
     */
    @JsonIgnore
    public Optional<Boolean> canAutoSync() {
        return canAutoSync;
    }

    /**
     * Indicates if the stream is for the hearing impaired.
     */
    @JsonIgnore
    public Optional<Boolean> hearingImpaired() {
        return hearingImpaired;
    }

    /**
     * Indicates if the stream is a dub.
     */
    @JsonIgnore
    public Optional<Boolean> dub() {
        return dub;
    }

    /**
     * Optional title for the stream (e.g., language variant).
     */
    @JsonIgnore
    public Optional<String> title() {
        return title;
    }

    public final static Builder builder() {
        return new Builder();
    }

    /**
     * Unique stream identifier.
     */
    public GetAllMediaLibraryStream withId(long id) {
        Utils.checkNotNull(id, "id");
        this.id = id;
        return this;
    }

    /**
     * Stream type (1=video, 2=audio, 3=subtitle).
     */
    public GetAllMediaLibraryStream withStreamType(int streamType) {
        Utils.checkNotNull(streamType, "streamType");
        this.streamType = streamType;
        return this;
    }

    /**
     * Indicates if this stream is default.
     */
    public GetAllMediaLibraryStream withDefault(boolean default_) {
        Utils.checkNotNull(default_, "default_");
        this.default_ = Optional.ofNullable(default_);
        return this;
    }

    /**
     * Indicates if this stream is default.
     */
    public GetAllMediaLibraryStream withDefault(Optional<Boolean> default_) {
        Utils.checkNotNull(default_, "default_");
        this.default_ = default_;
        return this;
    }

    /**
     * Codec used by the stream.
     */
    public GetAllMediaLibraryStream withCodec(String codec) {
        Utils.checkNotNull(codec, "codec");
        this.codec = codec;
        return this;
    }

    /**
     * Index of the stream.
     */
    public GetAllMediaLibraryStream withIndex(int index) {
        Utils.checkNotNull(index, "index");
        this.index = index;
        return this;
    }

    /**
     * Bitrate of the stream.
     */
    public GetAllMediaLibraryStream withBitrate(int bitrate) {
        Utils.checkNotNull(bitrate, "bitrate");
        this.bitrate = Optional.ofNullable(bitrate);
        return this;
    }

    /**
     * Bitrate of the stream.
     */
    public GetAllMediaLibraryStream withBitrate(Optional<Integer> bitrate) {
        Utils.checkNotNull(bitrate, "bitrate");
        this.bitrate = bitrate;
        return this;
    }

    /**
     * Language of the stream.
     */
    public GetAllMediaLibraryStream withLanguage(String language) {
        Utils.checkNotNull(language, "language");
        this.language = language;
        return this;
    }

    /**
     * Language tag (e.g., en).
     */
    public GetAllMediaLibraryStream withLanguageTag(String languageTag) {
        Utils.checkNotNull(languageTag, "languageTag");
        this.languageTag = languageTag;
        return this;
    }

    /**
     * ISO language code.
     */
    public GetAllMediaLibraryStream withLanguageCode(String languageCode) {
        Utils.checkNotNull(languageCode, "languageCode");
        this.languageCode = languageCode;
        return this;
    }

    /**
     * Indicates whether header compression is enabled.
     */
    public GetAllMediaLibraryStream withHeaderCompression(boolean headerCompression) {
        Utils.checkNotNull(headerCompression, "headerCompression");
        this.headerCompression = Optional.ofNullable(headerCompression);
        return this;
    }

    /**
     * Indicates whether header compression is enabled.
     */
    public GetAllMediaLibraryStream withHeaderCompression(Optional<Boolean> headerCompression) {
        Utils.checkNotNull(headerCompression, "headerCompression");
        this.headerCompression = headerCompression;
        return this;
    }

    /**
     * Dolby Vision BL compatibility ID.
     */
    public GetAllMediaLibraryStream withDOVIBLCompatID(int doviblCompatID) {
        Utils.checkNotNull(doviblCompatID, "doviblCompatID");
        this.doviblCompatID = Optional.ofNullable(doviblCompatID);
        return this;
    }

    /**
     * Dolby Vision BL compatibility ID.
     */
    public GetAllMediaLibraryStream withDOVIBLCompatID(Optional<Integer> doviblCompatID) {
        Utils.checkNotNull(doviblCompatID, "doviblCompatID");
        this.doviblCompatID = doviblCompatID;
        return this;
    }

    /**
     * Indicates if Dolby Vision BL is present.
     */
    public GetAllMediaLibraryStream withDOVIBLPresent(boolean doviblPresent) {
        Utils.checkNotNull(doviblPresent, "doviblPresent");
        this.doviblPresent = Optional.ofNullable(doviblPresent);
        return this;
    }

    /**
     * Indicates if Dolby Vision BL is present.
     */
    public GetAllMediaLibraryStream withDOVIBLPresent(Optional<Boolean> doviblPresent) {
        Utils.checkNotNull(doviblPresent, "doviblPresent");
        this.doviblPresent = doviblPresent;
        return this;
    }

    /**
     * Indicates if Dolby Vision EL is present.
     */
    public GetAllMediaLibraryStream withDOVIELPresent(boolean dovielPresent) {
        Utils.checkNotNull(dovielPresent, "dovielPresent");
        this.dovielPresent = Optional.ofNullable(dovielPresent);
        return this;
    }

    /**
     * Indicates if Dolby Vision EL is present.
     */
    public GetAllMediaLibraryStream withDOVIELPresent(Optional<Boolean> dovielPresent) {
        Utils.checkNotNull(dovielPresent, "dovielPresent");
        this.dovielPresent = dovielPresent;
        return this;
    }

    /**
     * Dolby Vision level.
     */
    public GetAllMediaLibraryStream withDOVILevel(int doviLevel) {
        Utils.checkNotNull(doviLevel, "doviLevel");
        this.doviLevel = Optional.ofNullable(doviLevel);
        return this;
    }

    /**
     * Dolby Vision level.
     */
    public GetAllMediaLibraryStream withDOVILevel(Optional<Integer> doviLevel) {
        Utils.checkNotNull(doviLevel, "doviLevel");
        this.doviLevel = doviLevel;
        return this;
    }

    /**
     * Indicates if Dolby Vision is present.
     */
    public GetAllMediaLibraryStream withDOVIPresent(boolean doviPresent) {
        Utils.checkNotNull(doviPresent, "doviPresent");
        this.doviPresent = Optional.ofNullable(doviPresent);
        return this;
    }

    /**
     * Indicates if Dolby Vision is present.
     */
    public GetAllMediaLibraryStream withDOVIPresent(Optional<Boolean> doviPresent) {
        Utils.checkNotNull(doviPresent, "doviPresent");
        this.doviPresent = doviPresent;
        return this;
    }

    /**
     * Dolby Vision profile.
     */
    public GetAllMediaLibraryStream withDOVIProfile(int doviProfile) {
        Utils.checkNotNull(doviProfile, "doviProfile");
        this.doviProfile = Optional.ofNullable(doviProfile);
        return this;
    }

    /**
     * Dolby Vision profile.
     */
    public GetAllMediaLibraryStream withDOVIProfile(Optional<Integer> doviProfile) {
        Utils.checkNotNull(doviProfile, "doviProfile");
        this.doviProfile = doviProfile;
        return this;
    }

    /**
     * Indicates if Dolby Vision RPU is present.
     */
    public GetAllMediaLibraryStream withDOVIRPUPresent(boolean dovirpuPresent) {
        Utils.checkNotNull(dovirpuPresent, "dovirpuPresent");
        this.dovirpuPresent = Optional.ofNullable(dovirpuPresent);
        return this;
    }

    /**
     * Indicates if Dolby Vision RPU is present.
     */
    public GetAllMediaLibraryStream withDOVIRPUPresent(Optional<Boolean> dovirpuPresent) {
        Utils.checkNotNull(dovirpuPresent, "dovirpuPresent");
        this.dovirpuPresent = dovirpuPresent;
        return this;
    }

    /**
     * Dolby Vision version.
     */
    public GetAllMediaLibraryStream withDOVIVersion(String doviVersion) {
        Utils.checkNotNull(doviVersion, "doviVersion");
        this.doviVersion = Optional.ofNullable(doviVersion);
        return this;
    }

    /**
     * Dolby Vision version.
     */
    public GetAllMediaLibraryStream withDOVIVersion(Optional<String> doviVersion) {
        Utils.checkNotNull(doviVersion, "doviVersion");
        this.doviVersion = doviVersion;
        return this;
    }

    /**
     * Bit depth of the video stream.
     */
    public GetAllMediaLibraryStream withBitDepth(int bitDepth) {
        Utils.checkNotNull(bitDepth, "bitDepth");
        this.bitDepth = Optional.ofNullable(bitDepth);
        return this;
    }

    /**
     * Bit depth of the video stream.
     */
    public GetAllMediaLibraryStream withBitDepth(Optional<Integer> bitDepth) {
        Utils.checkNotNull(bitDepth, "bitDepth");
        this.bitDepth = bitDepth;
        return this;
    }

    /**
     * Chroma sample location.
     */
    public GetAllMediaLibraryStream withChromaLocation(String chromaLocation) {
        Utils.checkNotNull(chromaLocation, "chromaLocation");
        this.chromaLocation = Optional.ofNullable(chromaLocation);
        return this;
    }

    /**
     * Chroma sample location.
     */
    public GetAllMediaLibraryStream withChromaLocation(Optional<String> chromaLocation) {
        Utils.checkNotNull(chromaLocation, "chromaLocation");
        this.chromaLocation = chromaLocation;
        return this;
    }

    /**
     * Chroma subsampling format.
     */
    public GetAllMediaLibraryStream withChromaSubsampling(String chromaSubsampling) {
        Utils.checkNotNull(chromaSubsampling, "chromaSubsampling");
        this.chromaSubsampling = Optional.ofNullable(chromaSubsampling);
        return this;
    }

    /**
     * Chroma subsampling format.
     */
    public GetAllMediaLibraryStream withChromaSubsampling(Optional<String> chromaSubsampling) {
        Utils.checkNotNull(chromaSubsampling, "chromaSubsampling");
        this.chromaSubsampling = chromaSubsampling;
        return this;
    }

    /**
     * Coded video height.
     */
    public GetAllMediaLibraryStream withCodedHeight(int codedHeight) {
        Utils.checkNotNull(codedHeight, "codedHeight");
        this.codedHeight = Optional.ofNullable(codedHeight);
        return this;
    }

    /**
     * Coded video height.
     */
    public GetAllMediaLibraryStream withCodedHeight(Optional<Integer> codedHeight) {
        Utils.checkNotNull(codedHeight, "codedHeight");
        this.codedHeight = codedHeight;
        return this;
    }

    /**
     * Coded video width.
     */
    public GetAllMediaLibraryStream withCodedWidth(int codedWidth) {
        Utils.checkNotNull(codedWidth, "codedWidth");
        this.codedWidth = Optional.ofNullable(codedWidth);
        return this;
    }

    /**
     * Coded video width.
     */
    public GetAllMediaLibraryStream withCodedWidth(Optional<Integer> codedWidth) {
        Utils.checkNotNull(codedWidth, "codedWidth");
        this.codedWidth = codedWidth;
        return this;
    }

    /**
     * Color primaries used.
     */
    public GetAllMediaLibraryStream withColorPrimaries(String colorPrimaries) {
        Utils.checkNotNull(colorPrimaries, "colorPrimaries");
        this.colorPrimaries = Optional.ofNullable(colorPrimaries);
        return this;
    }

    /**
     * Color primaries used.
     */
    public GetAllMediaLibraryStream withColorPrimaries(Optional<String> colorPrimaries) {
        Utils.checkNotNull(colorPrimaries, "colorPrimaries");
        this.colorPrimaries = colorPrimaries;
        return this;
    }

    /**
     * Color range (e.g., tv).
     */
    public GetAllMediaLibraryStream withColorRange(String colorRange) {
        Utils.checkNotNull(colorRange, "colorRange");
        this.colorRange = Optional.ofNullable(colorRange);
        return this;
    }

    /**
     * Color range (e.g., tv).
     */
    public GetAllMediaLibraryStream withColorRange(Optional<String> colorRange) {
        Utils.checkNotNull(colorRange, "colorRange");
        this.colorRange = colorRange;
        return this;
    }

    /**
     * Color space.
     */
    public GetAllMediaLibraryStream withColorSpace(String colorSpace) {
        Utils.checkNotNull(colorSpace, "colorSpace");
        this.colorSpace = Optional.ofNullable(colorSpace);
        return this;
    }

    /**
     * Color space.
     */
    public GetAllMediaLibraryStream withColorSpace(Optional<String> colorSpace) {
        Utils.checkNotNull(colorSpace, "colorSpace");
        this.colorSpace = colorSpace;
        return this;
    }

    /**
     * Color transfer characteristics.
     */
    public GetAllMediaLibraryStream withColorTrc(String colorTrc) {
        Utils.checkNotNull(colorTrc, "colorTrc");
        this.colorTrc = Optional.ofNullable(colorTrc);
        return this;
    }

    /**
     * Color transfer characteristics.
     */
    public GetAllMediaLibraryStream withColorTrc(Optional<String> colorTrc) {
        Utils.checkNotNull(colorTrc, "colorTrc");
        this.colorTrc = colorTrc;
        return this;
    }

    /**
     * Frame rate of the stream.
     */
    public GetAllMediaLibraryStream withFrameRate(float frameRate) {
        Utils.checkNotNull(frameRate, "frameRate");
        this.frameRate = Optional.ofNullable(frameRate);
        return this;
    }

    /**
     * Frame rate of the stream.
     */
    public GetAllMediaLibraryStream withFrameRate(Optional<Float> frameRate) {
        Utils.checkNotNull(frameRate, "frameRate");
        this.frameRate = frameRate;
        return this;
    }

    /**
     * Height of the video stream.
     */
    public GetAllMediaLibraryStream withHeight(int height) {
        Utils.checkNotNull(height, "height");
        this.height = Optional.ofNullable(height);
        return this;
    }

    /**
     * Height of the video stream.
     */
    public GetAllMediaLibraryStream withHeight(Optional<Integer> height) {
        Utils.checkNotNull(height, "height");
        this.height = height;
        return this;
    }

    /**
     * Video level.
     */
    public GetAllMediaLibraryStream withLevel(int level) {
        Utils.checkNotNull(level, "level");
        this.level = Optional.ofNullable(level);
        return this;
    }

    /**
     * Video level.
     */
    public GetAllMediaLibraryStream withLevel(Optional<Integer> level) {
        Utils.checkNotNull(level, "level");
        this.level = level;
        return this;
    }

    /**
     * Indicates if this is the original stream.
     */
    public GetAllMediaLibraryStream withOriginal(boolean original) {
        Utils.checkNotNull(original, "original");
        this.original = Optional.ofNullable(original);
        return this;
    }

    /**
     * Indicates if this is the original stream.
     */
    public GetAllMediaLibraryStream withOriginal(Optional<Boolean> original) {
        Utils.checkNotNull(original, "original");
        this.original = original;
        return this;
    }

    public GetAllMediaLibraryStream withHasScalingMatrix(boolean hasScalingMatrix) {
        Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix");
        this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix);
        return this;
    }

    public GetAllMediaLibraryStream withHasScalingMatrix(Optional<Boolean> hasScalingMatrix) {
        Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix");
        this.hasScalingMatrix = hasScalingMatrix;
        return this;
    }

    /**
     * Video profile.
     */
    public GetAllMediaLibraryStream withProfile(String profile) {
        Utils.checkNotNull(profile, "profile");
        this.profile = Optional.ofNullable(profile);
        return this;
    }

    /**
     * Video profile.
     */
    public GetAllMediaLibraryStream withProfile(Optional<String> profile) {
        Utils.checkNotNull(profile, "profile");
        this.profile = profile;
        return this;
    }

    public GetAllMediaLibraryStream withScanType(String scanType) {
        Utils.checkNotNull(scanType, "scanType");
        this.scanType = Optional.ofNullable(scanType);
        return this;
    }

    public GetAllMediaLibraryStream withScanType(Optional<String> scanType) {
        Utils.checkNotNull(scanType, "scanType");
        this.scanType = scanType;
        return this;
    }

    /**
     * Number of reference frames.
     */
    public GetAllMediaLibraryStream withRefFrames(int refFrames) {
        Utils.checkNotNull(refFrames, "refFrames");
        this.refFrames = Optional.ofNullable(refFrames);
        return this;
    }

    /**
     * Number of reference frames.
     */
    public GetAllMediaLibraryStream withRefFrames(Optional<Integer> refFrames) {
        Utils.checkNotNull(refFrames, "refFrames");
        this.refFrames = refFrames;
        return this;
    }

    /**
     * Width of the video stream.
     */
    public GetAllMediaLibraryStream withWidth(int width) {
        Utils.checkNotNull(width, "width");
        this.width = Optional.ofNullable(width);
        return this;
    }

    /**
     * Width of the video stream.
     */
    public GetAllMediaLibraryStream withWidth(Optional<Integer> width) {
        Utils.checkNotNull(width, "width");
        this.width = width;
        return this;
    }

    /**
     * Display title for the stream.
     */
    public GetAllMediaLibraryStream withDisplayTitle(String displayTitle) {
        Utils.checkNotNull(displayTitle, "displayTitle");
        this.displayTitle = displayTitle;
        return this;
    }

    /**
     * Extended display title for the stream.
     */
    public GetAllMediaLibraryStream withExtendedDisplayTitle(String extendedDisplayTitle) {
        Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle");
        this.extendedDisplayTitle = extendedDisplayTitle;
        return this;
    }

    /**
     * Indicates if this stream is selected (applicable for audio streams).
     */
    public GetAllMediaLibraryStream withSelected(boolean selected) {
        Utils.checkNotNull(selected, "selected");
        this.selected = Optional.ofNullable(selected);
        return this;
    }

    /**
     * Indicates if this stream is selected (applicable for audio streams).
     */
    public GetAllMediaLibraryStream withSelected(Optional<Boolean> selected) {
        Utils.checkNotNull(selected, "selected");
        this.selected = selected;
        return this;
    }

    public GetAllMediaLibraryStream withForced(boolean forced) {
        Utils.checkNotNull(forced, "forced");
        this.forced = Optional.ofNullable(forced);
        return this;
    }

    public GetAllMediaLibraryStream withForced(Optional<Boolean> forced) {
        Utils.checkNotNull(forced, "forced");
        this.forced = forced;
        return this;
    }

    /**
     * Number of audio channels (for audio streams).
     */
    public GetAllMediaLibraryStream withChannels(int channels) {
        Utils.checkNotNull(channels, "channels");
        this.channels = Optional.ofNullable(channels);
        return this;
    }

    /**
     * Number of audio channels (for audio streams).
     */
    public GetAllMediaLibraryStream withChannels(Optional<Integer> channels) {
        Utils.checkNotNull(channels, "channels");
        this.channels = channels;
        return this;
    }

    /**
     * Audio channel layout.
     */
    public GetAllMediaLibraryStream withAudioChannelLayout(String audioChannelLayout) {
        Utils.checkNotNull(audioChannelLayout, "audioChannelLayout");
        this.audioChannelLayout = Optional.ofNullable(audioChannelLayout);
        return this;
    }

    /**
     * Audio channel layout.
     */
    public GetAllMediaLibraryStream withAudioChannelLayout(Optional<String> audioChannelLayout) {
        Utils.checkNotNull(audioChannelLayout, "audioChannelLayout");
        this.audioChannelLayout = audioChannelLayout;
        return this;
    }

    /**
     * Sampling rate for the audio stream.
     */
    public GetAllMediaLibraryStream withSamplingRate(int samplingRate) {
        Utils.checkNotNull(samplingRate, "samplingRate");
        this.samplingRate = Optional.ofNullable(samplingRate);
        return this;
    }

    /**
     * Sampling rate for the audio stream.
     */
    public GetAllMediaLibraryStream withSamplingRate(Optional<Integer> samplingRate) {
        Utils.checkNotNull(samplingRate, "samplingRate");
        this.samplingRate = samplingRate;
        return this;
    }

    /**
     * Indicates if the stream can auto-sync.
     */
    public GetAllMediaLibraryStream withCanAutoSync(boolean canAutoSync) {
        Utils.checkNotNull(canAutoSync, "canAutoSync");
        this.canAutoSync = Optional.ofNullable(canAutoSync);
        return this;
    }

    /**
     * Indicates if the stream can auto-sync.
     */
    public GetAllMediaLibraryStream withCanAutoSync(Optional<Boolean> canAutoSync) {
        Utils.checkNotNull(canAutoSync, "canAutoSync");
        this.canAutoSync = canAutoSync;
        return this;
    }

    /**
     * Indicates if the stream is for the hearing impaired.
     */
    public GetAllMediaLibraryStream withHearingImpaired(boolean hearingImpaired) {
        Utils.checkNotNull(hearingImpaired, "hearingImpaired");
        this.hearingImpaired = Optional.ofNullable(hearingImpaired);
        return this;
    }

    /**
     * Indicates if the stream is for the hearing impaired.
     */
    public GetAllMediaLibraryStream withHearingImpaired(Optional<Boolean> hearingImpaired) {
        Utils.checkNotNull(hearingImpaired, "hearingImpaired");
        this.hearingImpaired = hearingImpaired;
        return this;
    }

    /**
     * Indicates if the stream is a dub.
     */
    public GetAllMediaLibraryStream withDub(boolean dub) {
        Utils.checkNotNull(dub, "dub");
        this.dub = Optional.ofNullable(dub);
        return this;
    }

    /**
     * Indicates if the stream is a dub.
     */
    public GetAllMediaLibraryStream withDub(Optional<Boolean> dub) {
        Utils.checkNotNull(dub, "dub");
        this.dub = dub;
        return this;
    }

    /**
     * Optional title for the stream (e.g., language variant).
     */
    public GetAllMediaLibraryStream withTitle(String title) {
        Utils.checkNotNull(title, "title");
        this.title = Optional.ofNullable(title);
        return this;
    }

    /**
     * Optional title for the stream (e.g., language variant).
     */
    public GetAllMediaLibraryStream withTitle(Optional<String> title) {
        Utils.checkNotNull(title, "title");
        this.title = title;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetAllMediaLibraryStream other = (GetAllMediaLibraryStream) o;
        return 
            Objects.deepEquals(this.id, other.id) &&
            Objects.deepEquals(this.streamType, other.streamType) &&
            Objects.deepEquals(this.default_, other.default_) &&
            Objects.deepEquals(this.codec, other.codec) &&
            Objects.deepEquals(this.index, other.index) &&
            Objects.deepEquals(this.bitrate, other.bitrate) &&
            Objects.deepEquals(this.language, other.language) &&
            Objects.deepEquals(this.languageTag, other.languageTag) &&
            Objects.deepEquals(this.languageCode, other.languageCode) &&
            Objects.deepEquals(this.headerCompression, other.headerCompression) &&
            Objects.deepEquals(this.doviblCompatID, other.doviblCompatID) &&
            Objects.deepEquals(this.doviblPresent, other.doviblPresent) &&
            Objects.deepEquals(this.dovielPresent, other.dovielPresent) &&
            Objects.deepEquals(this.doviLevel, other.doviLevel) &&
            Objects.deepEquals(this.doviPresent, other.doviPresent) &&
            Objects.deepEquals(this.doviProfile, other.doviProfile) &&
            Objects.deepEquals(this.dovirpuPresent, other.dovirpuPresent) &&
            Objects.deepEquals(this.doviVersion, other.doviVersion) &&
            Objects.deepEquals(this.bitDepth, other.bitDepth) &&
            Objects.deepEquals(this.chromaLocation, other.chromaLocation) &&
            Objects.deepEquals(this.chromaSubsampling, other.chromaSubsampling) &&
            Objects.deepEquals(this.codedHeight, other.codedHeight) &&
            Objects.deepEquals(this.codedWidth, other.codedWidth) &&
            Objects.deepEquals(this.colorPrimaries, other.colorPrimaries) &&
            Objects.deepEquals(this.colorRange, other.colorRange) &&
            Objects.deepEquals(this.colorSpace, other.colorSpace) &&
            Objects.deepEquals(this.colorTrc, other.colorTrc) &&
            Objects.deepEquals(this.frameRate, other.frameRate) &&
            Objects.deepEquals(this.height, other.height) &&
            Objects.deepEquals(this.level, other.level) &&
            Objects.deepEquals(this.original, other.original) &&
            Objects.deepEquals(this.hasScalingMatrix, other.hasScalingMatrix) &&
            Objects.deepEquals(this.profile, other.profile) &&
            Objects.deepEquals(this.scanType, other.scanType) &&
            Objects.deepEquals(this.refFrames, other.refFrames) &&
            Objects.deepEquals(this.width, other.width) &&
            Objects.deepEquals(this.displayTitle, other.displayTitle) &&
            Objects.deepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) &&
            Objects.deepEquals(this.selected, other.selected) &&
            Objects.deepEquals(this.forced, other.forced) &&
            Objects.deepEquals(this.channels, other.channels) &&
            Objects.deepEquals(this.audioChannelLayout, other.audioChannelLayout) &&
            Objects.deepEquals(this.samplingRate, other.samplingRate) &&
            Objects.deepEquals(this.canAutoSync, other.canAutoSync) &&
            Objects.deepEquals(this.hearingImpaired, other.hearingImpaired) &&
            Objects.deepEquals(this.dub, other.dub) &&
            Objects.deepEquals(this.title, other.title);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            id,
            streamType,
            default_,
            codec,
            index,
            bitrate,
            language,
            languageTag,
            languageCode,
            headerCompression,
            doviblCompatID,
            doviblPresent,
            dovielPresent,
            doviLevel,
            doviPresent,
            doviProfile,
            dovirpuPresent,
            doviVersion,
            bitDepth,
            chromaLocation,
            chromaSubsampling,
            codedHeight,
            codedWidth,
            colorPrimaries,
            colorRange,
            colorSpace,
            colorTrc,
            frameRate,
            height,
            level,
            original,
            hasScalingMatrix,
            profile,
            scanType,
            refFrames,
            width,
            displayTitle,
            extendedDisplayTitle,
            selected,
            forced,
            channels,
            audioChannelLayout,
            samplingRate,
            canAutoSync,
            hearingImpaired,
            dub,
            title);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetAllMediaLibraryStream.class,
                "id", id,
                "streamType", streamType,
                "default_", default_,
                "codec", codec,
                "index", index,
                "bitrate", bitrate,
                "language", language,
                "languageTag", languageTag,
                "languageCode", languageCode,
                "headerCompression", headerCompression,
                "doviblCompatID", doviblCompatID,
                "doviblPresent", doviblPresent,
                "dovielPresent", dovielPresent,
                "doviLevel", doviLevel,
                "doviPresent", doviPresent,
                "doviProfile", doviProfile,
                "dovirpuPresent", dovirpuPresent,
                "doviVersion", doviVersion,
                "bitDepth", bitDepth,
                "chromaLocation", chromaLocation,
                "chromaSubsampling", chromaSubsampling,
                "codedHeight", codedHeight,
                "codedWidth", codedWidth,
                "colorPrimaries", colorPrimaries,
                "colorRange", colorRange,
                "colorSpace", colorSpace,
                "colorTrc", colorTrc,
                "frameRate", frameRate,
                "height", height,
                "level", level,
                "original", original,
                "hasScalingMatrix", hasScalingMatrix,
                "profile", profile,
                "scanType", scanType,
                "refFrames", refFrames,
                "width", width,
                "displayTitle", displayTitle,
                "extendedDisplayTitle", extendedDisplayTitle,
                "selected", selected,
                "forced", forced,
                "channels", channels,
                "audioChannelLayout", audioChannelLayout,
                "samplingRate", samplingRate,
                "canAutoSync", canAutoSync,
                "hearingImpaired", hearingImpaired,
                "dub", dub,
                "title", title);
    }
    
    public final static class Builder {
 
        private Long id;
 
        private Integer streamType;
 
        private Optional<Boolean> default_ = Optional.empty();
 
        private String codec;
 
        private Integer index;
 
        private Optional<Integer> bitrate = Optional.empty();
 
        private String language;
 
        private String languageTag;
 
        private String languageCode;
 
        private Optional<Boolean> headerCompression = Optional.empty();
 
        private Optional<Integer> doviblCompatID = Optional.empty();
 
        private Optional<Boolean> doviblPresent = Optional.empty();
 
        private Optional<Boolean> dovielPresent = Optional.empty();
 
        private Optional<Integer> doviLevel = Optional.empty();
 
        private Optional<Boolean> doviPresent = Optional.empty();
 
        private Optional<Integer> doviProfile = Optional.empty();
 
        private Optional<Boolean> dovirpuPresent = Optional.empty();
 
        private Optional<String> doviVersion = Optional.empty();
 
        private Optional<Integer> bitDepth = Optional.empty();
 
        private Optional<String> chromaLocation = Optional.empty();
 
        private Optional<String> chromaSubsampling = Optional.empty();
 
        private Optional<Integer> codedHeight = Optional.empty();
 
        private Optional<Integer> codedWidth = Optional.empty();
 
        private Optional<String> colorPrimaries = Optional.empty();
 
        private Optional<String> colorRange = Optional.empty();
 
        private Optional<String> colorSpace = Optional.empty();
 
        private Optional<String> colorTrc = Optional.empty();
 
        private Optional<Float> frameRate = Optional.empty();
 
        private Optional<Integer> height = Optional.empty();
 
        private Optional<Integer> level = Optional.empty();
 
        private Optional<Boolean> original = Optional.empty();
 
        private Optional<Boolean> hasScalingMatrix = Optional.empty();
 
        private Optional<String> profile = Optional.empty();
 
        private Optional<String> scanType = Optional.empty();
 
        private Optional<Integer> refFrames = Optional.empty();
 
        private Optional<Integer> width = Optional.empty();
 
        private String displayTitle;
 
        private String extendedDisplayTitle;
 
        private Optional<Boolean> selected = Optional.empty();
 
        private Optional<Boolean> forced = Optional.empty();
 
        private Optional<Integer> channels = Optional.empty();
 
        private Optional<String> audioChannelLayout = Optional.empty();
 
        private Optional<Integer> samplingRate = Optional.empty();
 
        private Optional<Boolean> canAutoSync = Optional.empty();
 
        private Optional<Boolean> hearingImpaired = Optional.empty();
 
        private Optional<Boolean> dub = Optional.empty();
 
        private Optional<String> title = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * Unique stream identifier.
         */
        public Builder id(long id) {
            Utils.checkNotNull(id, "id");
            this.id = id;
            return this;
        }

        /**
         * Stream type (1=video, 2=audio, 3=subtitle).
         */
        public Builder streamType(int streamType) {
            Utils.checkNotNull(streamType, "streamType");
            this.streamType = streamType;
            return this;
        }

        /**
         * Indicates if this stream is default.
         */
        public Builder default_(boolean default_) {
            Utils.checkNotNull(default_, "default_");
            this.default_ = Optional.ofNullable(default_);
            return this;
        }

        /**
         * Indicates if this stream is default.
         */
        public Builder default_(Optional<Boolean> default_) {
            Utils.checkNotNull(default_, "default_");
            this.default_ = default_;
            return this;
        }

        /**
         * Codec used by the stream.
         */
        public Builder codec(String codec) {
            Utils.checkNotNull(codec, "codec");
            this.codec = codec;
            return this;
        }

        /**
         * Index of the stream.
         */
        public Builder index(int index) {
            Utils.checkNotNull(index, "index");
            this.index = index;
            return this;
        }

        /**
         * Bitrate of the stream.
         */
        public Builder bitrate(int bitrate) {
            Utils.checkNotNull(bitrate, "bitrate");
            this.bitrate = Optional.ofNullable(bitrate);
            return this;
        }

        /**
         * Bitrate of the stream.
         */
        public Builder bitrate(Optional<Integer> bitrate) {
            Utils.checkNotNull(bitrate, "bitrate");
            this.bitrate = bitrate;
            return this;
        }

        /**
         * Language of the stream.
         */
        public Builder language(String language) {
            Utils.checkNotNull(language, "language");
            this.language = language;
            return this;
        }

        /**
         * Language tag (e.g., en).
         */
        public Builder languageTag(String languageTag) {
            Utils.checkNotNull(languageTag, "languageTag");
            this.languageTag = languageTag;
            return this;
        }

        /**
         * ISO language code.
         */
        public Builder languageCode(String languageCode) {
            Utils.checkNotNull(languageCode, "languageCode");
            this.languageCode = languageCode;
            return this;
        }

        /**
         * Indicates whether header compression is enabled.
         */
        public Builder headerCompression(boolean headerCompression) {
            Utils.checkNotNull(headerCompression, "headerCompression");
            this.headerCompression = Optional.ofNullable(headerCompression);
            return this;
        }

        /**
         * Indicates whether header compression is enabled.
         */
        public Builder headerCompression(Optional<Boolean> headerCompression) {
            Utils.checkNotNull(headerCompression, "headerCompression");
            this.headerCompression = headerCompression;
            return this;
        }

        /**
         * Dolby Vision BL compatibility ID.
         */
        public Builder doviblCompatID(int doviblCompatID) {
            Utils.checkNotNull(doviblCompatID, "doviblCompatID");
            this.doviblCompatID = Optional.ofNullable(doviblCompatID);
            return this;
        }

        /**
         * Dolby Vision BL compatibility ID.
         */
        public Builder doviblCompatID(Optional<Integer> doviblCompatID) {
            Utils.checkNotNull(doviblCompatID, "doviblCompatID");
            this.doviblCompatID = doviblCompatID;
            return this;
        }

        /**
         * Indicates if Dolby Vision BL is present.
         */
        public Builder doviblPresent(boolean doviblPresent) {
            Utils.checkNotNull(doviblPresent, "doviblPresent");
            this.doviblPresent = Optional.ofNullable(doviblPresent);
            return this;
        }

        /**
         * Indicates if Dolby Vision BL is present.
         */
        public Builder doviblPresent(Optional<Boolean> doviblPresent) {
            Utils.checkNotNull(doviblPresent, "doviblPresent");
            this.doviblPresent = doviblPresent;
            return this;
        }

        /**
         * Indicates if Dolby Vision EL is present.
         */
        public Builder dovielPresent(boolean dovielPresent) {
            Utils.checkNotNull(dovielPresent, "dovielPresent");
            this.dovielPresent = Optional.ofNullable(dovielPresent);
            return this;
        }

        /**
         * Indicates if Dolby Vision EL is present.
         */
        public Builder dovielPresent(Optional<Boolean> dovielPresent) {
            Utils.checkNotNull(dovielPresent, "dovielPresent");
            this.dovielPresent = dovielPresent;
            return this;
        }

        /**
         * Dolby Vision level.
         */
        public Builder doviLevel(int doviLevel) {
            Utils.checkNotNull(doviLevel, "doviLevel");
            this.doviLevel = Optional.ofNullable(doviLevel);
            return this;
        }

        /**
         * Dolby Vision level.
         */
        public Builder doviLevel(Optional<Integer> doviLevel) {
            Utils.checkNotNull(doviLevel, "doviLevel");
            this.doviLevel = doviLevel;
            return this;
        }

        /**
         * Indicates if Dolby Vision is present.
         */
        public Builder doviPresent(boolean doviPresent) {
            Utils.checkNotNull(doviPresent, "doviPresent");
            this.doviPresent = Optional.ofNullable(doviPresent);
            return this;
        }

        /**
         * Indicates if Dolby Vision is present.
         */
        public Builder doviPresent(Optional<Boolean> doviPresent) {
            Utils.checkNotNull(doviPresent, "doviPresent");
            this.doviPresent = doviPresent;
            return this;
        }

        /**
         * Dolby Vision profile.
         */
        public Builder doviProfile(int doviProfile) {
            Utils.checkNotNull(doviProfile, "doviProfile");
            this.doviProfile = Optional.ofNullable(doviProfile);
            return this;
        }

        /**
         * Dolby Vision profile.
         */
        public Builder doviProfile(Optional<Integer> doviProfile) {
            Utils.checkNotNull(doviProfile, "doviProfile");
            this.doviProfile = doviProfile;
            return this;
        }

        /**
         * Indicates if Dolby Vision RPU is present.
         */
        public Builder dovirpuPresent(boolean dovirpuPresent) {
            Utils.checkNotNull(dovirpuPresent, "dovirpuPresent");
            this.dovirpuPresent = Optional.ofNullable(dovirpuPresent);
            return this;
        }

        /**
         * Indicates if Dolby Vision RPU is present.
         */
        public Builder dovirpuPresent(Optional<Boolean> dovirpuPresent) {
            Utils.checkNotNull(dovirpuPresent, "dovirpuPresent");
            this.dovirpuPresent = dovirpuPresent;
            return this;
        }

        /**
         * Dolby Vision version.
         */
        public Builder doviVersion(String doviVersion) {
            Utils.checkNotNull(doviVersion, "doviVersion");
            this.doviVersion = Optional.ofNullable(doviVersion);
            return this;
        }

        /**
         * Dolby Vision version.
         */
        public Builder doviVersion(Optional<String> doviVersion) {
            Utils.checkNotNull(doviVersion, "doviVersion");
            this.doviVersion = doviVersion;
            return this;
        }

        /**
         * Bit depth of the video stream.
         */
        public Builder bitDepth(int bitDepth) {
            Utils.checkNotNull(bitDepth, "bitDepth");
            this.bitDepth = Optional.ofNullable(bitDepth);
            return this;
        }

        /**
         * Bit depth of the video stream.
         */
        public Builder bitDepth(Optional<Integer> bitDepth) {
            Utils.checkNotNull(bitDepth, "bitDepth");
            this.bitDepth = bitDepth;
            return this;
        }

        /**
         * Chroma sample location.
         */
        public Builder chromaLocation(String chromaLocation) {
            Utils.checkNotNull(chromaLocation, "chromaLocation");
            this.chromaLocation = Optional.ofNullable(chromaLocation);
            return this;
        }

        /**
         * Chroma sample location.
         */
        public Builder chromaLocation(Optional<String> chromaLocation) {
            Utils.checkNotNull(chromaLocation, "chromaLocation");
            this.chromaLocation = chromaLocation;
            return this;
        }

        /**
         * Chroma subsampling format.
         */
        public Builder chromaSubsampling(String chromaSubsampling) {
            Utils.checkNotNull(chromaSubsampling, "chromaSubsampling");
            this.chromaSubsampling = Optional.ofNullable(chromaSubsampling);
            return this;
        }

        /**
         * Chroma subsampling format.
         */
        public Builder chromaSubsampling(Optional<String> chromaSubsampling) {
            Utils.checkNotNull(chromaSubsampling, "chromaSubsampling");
            this.chromaSubsampling = chromaSubsampling;
            return this;
        }

        /**
         * Coded video height.
         */
        public Builder codedHeight(int codedHeight) {
            Utils.checkNotNull(codedHeight, "codedHeight");
            this.codedHeight = Optional.ofNullable(codedHeight);
            return this;
        }

        /**
         * Coded video height.
         */
        public Builder codedHeight(Optional<Integer> codedHeight) {
            Utils.checkNotNull(codedHeight, "codedHeight");
            this.codedHeight = codedHeight;
            return this;
        }

        /**
         * Coded video width.
         */
        public Builder codedWidth(int codedWidth) {
            Utils.checkNotNull(codedWidth, "codedWidth");
            this.codedWidth = Optional.ofNullable(codedWidth);
            return this;
        }

        /**
         * Coded video width.
         */
        public Builder codedWidth(Optional<Integer> codedWidth) {
            Utils.checkNotNull(codedWidth, "codedWidth");
            this.codedWidth = codedWidth;
            return this;
        }

        /**
         * Color primaries used.
         */
        public Builder colorPrimaries(String colorPrimaries) {
            Utils.checkNotNull(colorPrimaries, "colorPrimaries");
            this.colorPrimaries = Optional.ofNullable(colorPrimaries);
            return this;
        }

        /**
         * Color primaries used.
         */
        public Builder colorPrimaries(Optional<String> colorPrimaries) {
            Utils.checkNotNull(colorPrimaries, "colorPrimaries");
            this.colorPrimaries = colorPrimaries;
            return this;
        }

        /**
         * Color range (e.g., tv).
         */
        public Builder colorRange(String colorRange) {
            Utils.checkNotNull(colorRange, "colorRange");
            this.colorRange = Optional.ofNullable(colorRange);
            return this;
        }

        /**
         * Color range (e.g., tv).
         */
        public Builder colorRange(Optional<String> colorRange) {
            Utils.checkNotNull(colorRange, "colorRange");
            this.colorRange = colorRange;
            return this;
        }

        /**
         * Color space.
         */
        public Builder colorSpace(String colorSpace) {
            Utils.checkNotNull(colorSpace, "colorSpace");
            this.colorSpace = Optional.ofNullable(colorSpace);
            return this;
        }

        /**
         * Color space.
         */
        public Builder colorSpace(Optional<String> colorSpace) {
            Utils.checkNotNull(colorSpace, "colorSpace");
            this.colorSpace = colorSpace;
            return this;
        }

        /**
         * Color transfer characteristics.
         */
        public Builder colorTrc(String colorTrc) {
            Utils.checkNotNull(colorTrc, "colorTrc");
            this.colorTrc = Optional.ofNullable(colorTrc);
            return this;
        }

        /**
         * Color transfer characteristics.
         */
        public Builder colorTrc(Optional<String> colorTrc) {
            Utils.checkNotNull(colorTrc, "colorTrc");
            this.colorTrc = colorTrc;
            return this;
        }

        /**
         * Frame rate of the stream.
         */
        public Builder frameRate(float frameRate) {
            Utils.checkNotNull(frameRate, "frameRate");
            this.frameRate = Optional.ofNullable(frameRate);
            return this;
        }

        /**
         * Frame rate of the stream.
         */
        public Builder frameRate(Optional<Float> frameRate) {
            Utils.checkNotNull(frameRate, "frameRate");
            this.frameRate = frameRate;
            return this;
        }

        /**
         * Height of the video stream.
         */
        public Builder height(int height) {
            Utils.checkNotNull(height, "height");
            this.height = Optional.ofNullable(height);
            return this;
        }

        /**
         * Height of the video stream.
         */
        public Builder height(Optional<Integer> height) {
            Utils.checkNotNull(height, "height");
            this.height = height;
            return this;
        }

        /**
         * Video level.
         */
        public Builder level(int level) {
            Utils.checkNotNull(level, "level");
            this.level = Optional.ofNullable(level);
            return this;
        }

        /**
         * Video level.
         */
        public Builder level(Optional<Integer> level) {
            Utils.checkNotNull(level, "level");
            this.level = level;
            return this;
        }

        /**
         * Indicates if this is the original stream.
         */
        public Builder original(boolean original) {
            Utils.checkNotNull(original, "original");
            this.original = Optional.ofNullable(original);
            return this;
        }

        /**
         * Indicates if this is the original stream.
         */
        public Builder original(Optional<Boolean> original) {
            Utils.checkNotNull(original, "original");
            this.original = original;
            return this;
        }

        public Builder hasScalingMatrix(boolean hasScalingMatrix) {
            Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix");
            this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix);
            return this;
        }

        public Builder hasScalingMatrix(Optional<Boolean> hasScalingMatrix) {
            Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix");
            this.hasScalingMatrix = hasScalingMatrix;
            return this;
        }

        /**
         * Video profile.
         */
        public Builder profile(String profile) {
            Utils.checkNotNull(profile, "profile");
            this.profile = Optional.ofNullable(profile);
            return this;
        }

        /**
         * Video profile.
         */
        public Builder profile(Optional<String> profile) {
            Utils.checkNotNull(profile, "profile");
            this.profile = profile;
            return this;
        }

        public Builder scanType(String scanType) {
            Utils.checkNotNull(scanType, "scanType");
            this.scanType = Optional.ofNullable(scanType);
            return this;
        }

        public Builder scanType(Optional<String> scanType) {
            Utils.checkNotNull(scanType, "scanType");
            this.scanType = scanType;
            return this;
        }

        /**
         * Number of reference frames.
         */
        public Builder refFrames(int refFrames) {
            Utils.checkNotNull(refFrames, "refFrames");
            this.refFrames = Optional.ofNullable(refFrames);
            return this;
        }

        /**
         * Number of reference frames.
         */
        public Builder refFrames(Optional<Integer> refFrames) {
            Utils.checkNotNull(refFrames, "refFrames");
            this.refFrames = refFrames;
            return this;
        }

        /**
         * Width of the video stream.
         */
        public Builder width(int width) {
            Utils.checkNotNull(width, "width");
            this.width = Optional.ofNullable(width);
            return this;
        }

        /**
         * Width of the video stream.
         */
        public Builder width(Optional<Integer> width) {
            Utils.checkNotNull(width, "width");
            this.width = width;
            return this;
        }

        /**
         * Display title for the stream.
         */
        public Builder displayTitle(String displayTitle) {
            Utils.checkNotNull(displayTitle, "displayTitle");
            this.displayTitle = displayTitle;
            return this;
        }

        /**
         * Extended display title for the stream.
         */
        public Builder extendedDisplayTitle(String extendedDisplayTitle) {
            Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle");
            this.extendedDisplayTitle = extendedDisplayTitle;
            return this;
        }

        /**
         * Indicates if this stream is selected (applicable for audio streams).
         */
        public Builder selected(boolean selected) {
            Utils.checkNotNull(selected, "selected");
            this.selected = Optional.ofNullable(selected);
            return this;
        }

        /**
         * Indicates if this stream is selected (applicable for audio streams).
         */
        public Builder selected(Optional<Boolean> selected) {
            Utils.checkNotNull(selected, "selected");
            this.selected = selected;
            return this;
        }

        public Builder forced(boolean forced) {
            Utils.checkNotNull(forced, "forced");
            this.forced = Optional.ofNullable(forced);
            return this;
        }

        public Builder forced(Optional<Boolean> forced) {
            Utils.checkNotNull(forced, "forced");
            this.forced = forced;
            return this;
        }

        /**
         * Number of audio channels (for audio streams).
         */
        public Builder channels(int channels) {
            Utils.checkNotNull(channels, "channels");
            this.channels = Optional.ofNullable(channels);
            return this;
        }

        /**
         * Number of audio channels (for audio streams).
         */
        public Builder channels(Optional<Integer> channels) {
            Utils.checkNotNull(channels, "channels");
            this.channels = channels;
            return this;
        }

        /**
         * Audio channel layout.
         */
        public Builder audioChannelLayout(String audioChannelLayout) {
            Utils.checkNotNull(audioChannelLayout, "audioChannelLayout");
            this.audioChannelLayout = Optional.ofNullable(audioChannelLayout);
            return this;
        }

        /**
         * Audio channel layout.
         */
        public Builder audioChannelLayout(Optional<String> audioChannelLayout) {
            Utils.checkNotNull(audioChannelLayout, "audioChannelLayout");
            this.audioChannelLayout = audioChannelLayout;
            return this;
        }

        /**
         * Sampling rate for the audio stream.
         */
        public Builder samplingRate(int samplingRate) {
            Utils.checkNotNull(samplingRate, "samplingRate");
            this.samplingRate = Optional.ofNullable(samplingRate);
            return this;
        }

        /**
         * Sampling rate for the audio stream.
         */
        public Builder samplingRate(Optional<Integer> samplingRate) {
            Utils.checkNotNull(samplingRate, "samplingRate");
            this.samplingRate = samplingRate;
            return this;
        }

        /**
         * Indicates if the stream can auto-sync.
         */
        public Builder canAutoSync(boolean canAutoSync) {
            Utils.checkNotNull(canAutoSync, "canAutoSync");
            this.canAutoSync = Optional.ofNullable(canAutoSync);
            return this;
        }

        /**
         * Indicates if the stream can auto-sync.
         */
        public Builder canAutoSync(Optional<Boolean> canAutoSync) {
            Utils.checkNotNull(canAutoSync, "canAutoSync");
            this.canAutoSync = canAutoSync;
            return this;
        }

        /**
         * Indicates if the stream is for the hearing impaired.
         */
        public Builder hearingImpaired(boolean hearingImpaired) {
            Utils.checkNotNull(hearingImpaired, "hearingImpaired");
            this.hearingImpaired = Optional.ofNullable(hearingImpaired);
            return this;
        }

        /**
         * Indicates if the stream is for the hearing impaired.
         */
        public Builder hearingImpaired(Optional<Boolean> hearingImpaired) {
            Utils.checkNotNull(hearingImpaired, "hearingImpaired");
            this.hearingImpaired = hearingImpaired;
            return this;
        }

        /**
         * Indicates if the stream is a dub.
         */
        public Builder dub(boolean dub) {
            Utils.checkNotNull(dub, "dub");
            this.dub = Optional.ofNullable(dub);
            return this;
        }

        /**
         * Indicates if the stream is a dub.
         */
        public Builder dub(Optional<Boolean> dub) {
            Utils.checkNotNull(dub, "dub");
            this.dub = dub;
            return this;
        }

        /**
         * Optional title for the stream (e.g., language variant).
         */
        public Builder title(String title) {
            Utils.checkNotNull(title, "title");
            this.title = Optional.ofNullable(title);
            return this;
        }

        /**
         * Optional title for the stream (e.g., language variant).
         */
        public Builder title(Optional<String> title) {
            Utils.checkNotNull(title, "title");
            this.title = title;
            return this;
        }
        
        public GetAllMediaLibraryStream build() {
            return new GetAllMediaLibraryStream(
                id,
                streamType,
                default_,
                codec,
                index,
                bitrate,
                language,
                languageTag,
                languageCode,
                headerCompression,
                doviblCompatID,
                doviblPresent,
                dovielPresent,
                doviLevel,
                doviPresent,
                doviProfile,
                dovirpuPresent,
                doviVersion,
                bitDepth,
                chromaLocation,
                chromaSubsampling,
                codedHeight,
                codedWidth,
                colorPrimaries,
                colorRange,
                colorSpace,
                colorTrc,
                frameRate,
                height,
                level,
                original,
                hasScalingMatrix,
                profile,
                scanType,
                refFrames,
                width,
                displayTitle,
                extendedDisplayTitle,
                selected,
                forced,
                channels,
                audioChannelLayout,
                samplingRate,
                canAutoSync,
                hearingImpaired,
                dub,
                title);
        }
    }
}

