/* 
 * 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.Double;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Objects;
import java.util.Optional;


public class GetSearchResultsMetadata {

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("librarySectionID")
    private Optional<Double> librarySectionID;

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

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("ratingKey")
    private Optional<Double> ratingKey;

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

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

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

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

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("rating")
    private Optional<Double> rating;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("audienceRating")
    private Optional<Double> audienceRating;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("year")
    private Optional<Double> year;

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("duration")
    private Optional<Double> duration;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("originallyAvailableAt")
    private Optional<OffsetDateTime> originallyAvailableAt;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("addedAt")
    private Optional<Double> addedAt;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("updatedAt")
    private Optional<Double> updatedAt;

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

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Media")
    private Optional<? extends List<GetSearchResultsMedia>> media;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Genre")
    private Optional<? extends List<GetSearchResultsGenre>> genre;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Director")
    private Optional<? extends List<GetSearchResultsDirector>> director;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Writer")
    private Optional<? extends List<GetSearchResultsWriter>> writer;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Country")
    private Optional<? extends List<GetSearchResultsCountry>> country;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Role")
    private Optional<? extends List<GetSearchResultsRole>> role;

    @JsonCreator
    public GetSearchResultsMetadata(
            @JsonProperty("allowSync") Optional<Boolean> allowSync,
            @JsonProperty("librarySectionID") Optional<Double> librarySectionID,
            @JsonProperty("librarySectionTitle") Optional<String> librarySectionTitle,
            @JsonProperty("librarySectionUUID") Optional<String> librarySectionUUID,
            @JsonProperty("personal") Optional<Boolean> personal,
            @JsonProperty("sourceTitle") Optional<String> sourceTitle,
            @JsonProperty("ratingKey") Optional<Double> ratingKey,
            @JsonProperty("key") Optional<String> key,
            @JsonProperty("guid") Optional<String> guid,
            @JsonProperty("studio") Optional<String> studio,
            @JsonProperty("type") Optional<String> type,
            @JsonProperty("title") Optional<String> title,
            @JsonProperty("contentRating") Optional<String> contentRating,
            @JsonProperty("summary") Optional<String> summary,
            @JsonProperty("rating") Optional<Double> rating,
            @JsonProperty("audienceRating") Optional<Double> audienceRating,
            @JsonProperty("year") Optional<Double> year,
            @JsonProperty("tagline") Optional<String> tagline,
            @JsonProperty("thumb") Optional<String> thumb,
            @JsonProperty("art") Optional<String> art,
            @JsonProperty("duration") Optional<Double> duration,
            @JsonProperty("originallyAvailableAt") Optional<OffsetDateTime> originallyAvailableAt,
            @JsonProperty("addedAt") Optional<Double> addedAt,
            @JsonProperty("updatedAt") Optional<Double> updatedAt,
            @JsonProperty("audienceRatingImage") Optional<String> audienceRatingImage,
            @JsonProperty("chapterSource") Optional<String> chapterSource,
            @JsonProperty("primaryExtraKey") Optional<String> primaryExtraKey,
            @JsonProperty("ratingImage") Optional<String> ratingImage,
            @JsonProperty("Media") Optional<? extends List<GetSearchResultsMedia>> media,
            @JsonProperty("Genre") Optional<? extends List<GetSearchResultsGenre>> genre,
            @JsonProperty("Director") Optional<? extends List<GetSearchResultsDirector>> director,
            @JsonProperty("Writer") Optional<? extends List<GetSearchResultsWriter>> writer,
            @JsonProperty("Country") Optional<? extends List<GetSearchResultsCountry>> country,
            @JsonProperty("Role") Optional<? extends List<GetSearchResultsRole>> role) {
        Utils.checkNotNull(allowSync, "allowSync");
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        Utils.checkNotNull(personal, "personal");
        Utils.checkNotNull(sourceTitle, "sourceTitle");
        Utils.checkNotNull(ratingKey, "ratingKey");
        Utils.checkNotNull(key, "key");
        Utils.checkNotNull(guid, "guid");
        Utils.checkNotNull(studio, "studio");
        Utils.checkNotNull(type, "type");
        Utils.checkNotNull(title, "title");
        Utils.checkNotNull(contentRating, "contentRating");
        Utils.checkNotNull(summary, "summary");
        Utils.checkNotNull(rating, "rating");
        Utils.checkNotNull(audienceRating, "audienceRating");
        Utils.checkNotNull(year, "year");
        Utils.checkNotNull(tagline, "tagline");
        Utils.checkNotNull(thumb, "thumb");
        Utils.checkNotNull(art, "art");
        Utils.checkNotNull(duration, "duration");
        Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt");
        Utils.checkNotNull(addedAt, "addedAt");
        Utils.checkNotNull(updatedAt, "updatedAt");
        Utils.checkNotNull(audienceRatingImage, "audienceRatingImage");
        Utils.checkNotNull(chapterSource, "chapterSource");
        Utils.checkNotNull(primaryExtraKey, "primaryExtraKey");
        Utils.checkNotNull(ratingImage, "ratingImage");
        Utils.checkNotNull(media, "media");
        Utils.checkNotNull(genre, "genre");
        Utils.checkNotNull(director, "director");
        Utils.checkNotNull(writer, "writer");
        Utils.checkNotNull(country, "country");
        Utils.checkNotNull(role, "role");
        this.allowSync = allowSync;
        this.librarySectionID = librarySectionID;
        this.librarySectionTitle = librarySectionTitle;
        this.librarySectionUUID = librarySectionUUID;
        this.personal = personal;
        this.sourceTitle = sourceTitle;
        this.ratingKey = ratingKey;
        this.key = key;
        this.guid = guid;
        this.studio = studio;
        this.type = type;
        this.title = title;
        this.contentRating = contentRating;
        this.summary = summary;
        this.rating = rating;
        this.audienceRating = audienceRating;
        this.year = year;
        this.tagline = tagline;
        this.thumb = thumb;
        this.art = art;
        this.duration = duration;
        this.originallyAvailableAt = originallyAvailableAt;
        this.addedAt = addedAt;
        this.updatedAt = updatedAt;
        this.audienceRatingImage = audienceRatingImage;
        this.chapterSource = chapterSource;
        this.primaryExtraKey = primaryExtraKey;
        this.ratingImage = ratingImage;
        this.media = media;
        this.genre = genre;
        this.director = director;
        this.writer = writer;
        this.country = country;
        this.role = role;
    }
    
    public GetSearchResultsMetadata() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

    @JsonIgnore
    public Optional<Double> librarySectionID() {
        return librarySectionID;
    }

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

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

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

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

    @JsonIgnore
    public Optional<Double> ratingKey() {
        return ratingKey;
    }

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

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

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

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

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

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

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

    @JsonIgnore
    public Optional<Double> rating() {
        return rating;
    }

    @JsonIgnore
    public Optional<Double> audienceRating() {
        return audienceRating;
    }

    @JsonIgnore
    public Optional<Double> year() {
        return year;
    }

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

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

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

    @JsonIgnore
    public Optional<Double> duration() {
        return duration;
    }

    @JsonIgnore
    public Optional<OffsetDateTime> originallyAvailableAt() {
        return originallyAvailableAt;
    }

    @JsonIgnore
    public Optional<Double> addedAt() {
        return addedAt;
    }

    @JsonIgnore
    public Optional<Double> updatedAt() {
        return updatedAt;
    }

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

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

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

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

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetSearchResultsMedia>> media() {
        return (Optional<List<GetSearchResultsMedia>>) media;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetSearchResultsGenre>> genre() {
        return (Optional<List<GetSearchResultsGenre>>) genre;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetSearchResultsDirector>> director() {
        return (Optional<List<GetSearchResultsDirector>>) director;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetSearchResultsWriter>> writer() {
        return (Optional<List<GetSearchResultsWriter>>) writer;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetSearchResultsCountry>> country() {
        return (Optional<List<GetSearchResultsCountry>>) country;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetSearchResultsRole>> role() {
        return (Optional<List<GetSearchResultsRole>>) role;
    }

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

    public GetSearchResultsMetadata withAllowSync(boolean allowSync) {
        Utils.checkNotNull(allowSync, "allowSync");
        this.allowSync = Optional.ofNullable(allowSync);
        return this;
    }

    public GetSearchResultsMetadata withAllowSync(Optional<Boolean> allowSync) {
        Utils.checkNotNull(allowSync, "allowSync");
        this.allowSync = allowSync;
        return this;
    }

    public GetSearchResultsMetadata withLibrarySectionID(double librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = Optional.ofNullable(librarySectionID);
        return this;
    }

    public GetSearchResultsMetadata withLibrarySectionID(Optional<Double> librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = librarySectionID;
        return this;
    }

    public GetSearchResultsMetadata withLibrarySectionTitle(String librarySectionTitle) {
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        this.librarySectionTitle = Optional.ofNullable(librarySectionTitle);
        return this;
    }

    public GetSearchResultsMetadata withLibrarySectionTitle(Optional<String> librarySectionTitle) {
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        this.librarySectionTitle = librarySectionTitle;
        return this;
    }

    public GetSearchResultsMetadata withLibrarySectionUUID(String librarySectionUUID) {
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        this.librarySectionUUID = Optional.ofNullable(librarySectionUUID);
        return this;
    }

    public GetSearchResultsMetadata withLibrarySectionUUID(Optional<String> librarySectionUUID) {
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        this.librarySectionUUID = librarySectionUUID;
        return this;
    }

    public GetSearchResultsMetadata withPersonal(boolean personal) {
        Utils.checkNotNull(personal, "personal");
        this.personal = Optional.ofNullable(personal);
        return this;
    }

    public GetSearchResultsMetadata withPersonal(Optional<Boolean> personal) {
        Utils.checkNotNull(personal, "personal");
        this.personal = personal;
        return this;
    }

    public GetSearchResultsMetadata withSourceTitle(String sourceTitle) {
        Utils.checkNotNull(sourceTitle, "sourceTitle");
        this.sourceTitle = Optional.ofNullable(sourceTitle);
        return this;
    }

    public GetSearchResultsMetadata withSourceTitle(Optional<String> sourceTitle) {
        Utils.checkNotNull(sourceTitle, "sourceTitle");
        this.sourceTitle = sourceTitle;
        return this;
    }

    public GetSearchResultsMetadata withRatingKey(double ratingKey) {
        Utils.checkNotNull(ratingKey, "ratingKey");
        this.ratingKey = Optional.ofNullable(ratingKey);
        return this;
    }

    public GetSearchResultsMetadata withRatingKey(Optional<Double> ratingKey) {
        Utils.checkNotNull(ratingKey, "ratingKey");
        this.ratingKey = ratingKey;
        return this;
    }

    public GetSearchResultsMetadata withKey(String key) {
        Utils.checkNotNull(key, "key");
        this.key = Optional.ofNullable(key);
        return this;
    }

    public GetSearchResultsMetadata withKey(Optional<String> key) {
        Utils.checkNotNull(key, "key");
        this.key = key;
        return this;
    }

    public GetSearchResultsMetadata withGuid(String guid) {
        Utils.checkNotNull(guid, "guid");
        this.guid = Optional.ofNullable(guid);
        return this;
    }

    public GetSearchResultsMetadata withGuid(Optional<String> guid) {
        Utils.checkNotNull(guid, "guid");
        this.guid = guid;
        return this;
    }

    public GetSearchResultsMetadata withStudio(String studio) {
        Utils.checkNotNull(studio, "studio");
        this.studio = Optional.ofNullable(studio);
        return this;
    }

    public GetSearchResultsMetadata withStudio(Optional<String> studio) {
        Utils.checkNotNull(studio, "studio");
        this.studio = studio;
        return this;
    }

    public GetSearchResultsMetadata withType(String type) {
        Utils.checkNotNull(type, "type");
        this.type = Optional.ofNullable(type);
        return this;
    }

    public GetSearchResultsMetadata withType(Optional<String> type) {
        Utils.checkNotNull(type, "type");
        this.type = type;
        return this;
    }

    public GetSearchResultsMetadata withTitle(String title) {
        Utils.checkNotNull(title, "title");
        this.title = Optional.ofNullable(title);
        return this;
    }

    public GetSearchResultsMetadata withTitle(Optional<String> title) {
        Utils.checkNotNull(title, "title");
        this.title = title;
        return this;
    }

    public GetSearchResultsMetadata withContentRating(String contentRating) {
        Utils.checkNotNull(contentRating, "contentRating");
        this.contentRating = Optional.ofNullable(contentRating);
        return this;
    }

    public GetSearchResultsMetadata withContentRating(Optional<String> contentRating) {
        Utils.checkNotNull(contentRating, "contentRating");
        this.contentRating = contentRating;
        return this;
    }

    public GetSearchResultsMetadata withSummary(String summary) {
        Utils.checkNotNull(summary, "summary");
        this.summary = Optional.ofNullable(summary);
        return this;
    }

    public GetSearchResultsMetadata withSummary(Optional<String> summary) {
        Utils.checkNotNull(summary, "summary");
        this.summary = summary;
        return this;
    }

    public GetSearchResultsMetadata withRating(double rating) {
        Utils.checkNotNull(rating, "rating");
        this.rating = Optional.ofNullable(rating);
        return this;
    }

    public GetSearchResultsMetadata withRating(Optional<Double> rating) {
        Utils.checkNotNull(rating, "rating");
        this.rating = rating;
        return this;
    }

    public GetSearchResultsMetadata withAudienceRating(double audienceRating) {
        Utils.checkNotNull(audienceRating, "audienceRating");
        this.audienceRating = Optional.ofNullable(audienceRating);
        return this;
    }

    public GetSearchResultsMetadata withAudienceRating(Optional<Double> audienceRating) {
        Utils.checkNotNull(audienceRating, "audienceRating");
        this.audienceRating = audienceRating;
        return this;
    }

    public GetSearchResultsMetadata withYear(double year) {
        Utils.checkNotNull(year, "year");
        this.year = Optional.ofNullable(year);
        return this;
    }

    public GetSearchResultsMetadata withYear(Optional<Double> year) {
        Utils.checkNotNull(year, "year");
        this.year = year;
        return this;
    }

    public GetSearchResultsMetadata withTagline(String tagline) {
        Utils.checkNotNull(tagline, "tagline");
        this.tagline = Optional.ofNullable(tagline);
        return this;
    }

    public GetSearchResultsMetadata withTagline(Optional<String> tagline) {
        Utils.checkNotNull(tagline, "tagline");
        this.tagline = tagline;
        return this;
    }

    public GetSearchResultsMetadata withThumb(String thumb) {
        Utils.checkNotNull(thumb, "thumb");
        this.thumb = Optional.ofNullable(thumb);
        return this;
    }

    public GetSearchResultsMetadata withThumb(Optional<String> thumb) {
        Utils.checkNotNull(thumb, "thumb");
        this.thumb = thumb;
        return this;
    }

    public GetSearchResultsMetadata withArt(String art) {
        Utils.checkNotNull(art, "art");
        this.art = Optional.ofNullable(art);
        return this;
    }

    public GetSearchResultsMetadata withArt(Optional<String> art) {
        Utils.checkNotNull(art, "art");
        this.art = art;
        return this;
    }

    public GetSearchResultsMetadata withDuration(double duration) {
        Utils.checkNotNull(duration, "duration");
        this.duration = Optional.ofNullable(duration);
        return this;
    }

    public GetSearchResultsMetadata withDuration(Optional<Double> duration) {
        Utils.checkNotNull(duration, "duration");
        this.duration = duration;
        return this;
    }

    public GetSearchResultsMetadata withOriginallyAvailableAt(OffsetDateTime originallyAvailableAt) {
        Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt");
        this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt);
        return this;
    }

    public GetSearchResultsMetadata withOriginallyAvailableAt(Optional<OffsetDateTime> originallyAvailableAt) {
        Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt");
        this.originallyAvailableAt = originallyAvailableAt;
        return this;
    }

    public GetSearchResultsMetadata withAddedAt(double addedAt) {
        Utils.checkNotNull(addedAt, "addedAt");
        this.addedAt = Optional.ofNullable(addedAt);
        return this;
    }

    public GetSearchResultsMetadata withAddedAt(Optional<Double> addedAt) {
        Utils.checkNotNull(addedAt, "addedAt");
        this.addedAt = addedAt;
        return this;
    }

    public GetSearchResultsMetadata withUpdatedAt(double updatedAt) {
        Utils.checkNotNull(updatedAt, "updatedAt");
        this.updatedAt = Optional.ofNullable(updatedAt);
        return this;
    }

    public GetSearchResultsMetadata withUpdatedAt(Optional<Double> updatedAt) {
        Utils.checkNotNull(updatedAt, "updatedAt");
        this.updatedAt = updatedAt;
        return this;
    }

    public GetSearchResultsMetadata withAudienceRatingImage(String audienceRatingImage) {
        Utils.checkNotNull(audienceRatingImage, "audienceRatingImage");
        this.audienceRatingImage = Optional.ofNullable(audienceRatingImage);
        return this;
    }

    public GetSearchResultsMetadata withAudienceRatingImage(Optional<String> audienceRatingImage) {
        Utils.checkNotNull(audienceRatingImage, "audienceRatingImage");
        this.audienceRatingImage = audienceRatingImage;
        return this;
    }

    public GetSearchResultsMetadata withChapterSource(String chapterSource) {
        Utils.checkNotNull(chapterSource, "chapterSource");
        this.chapterSource = Optional.ofNullable(chapterSource);
        return this;
    }

    public GetSearchResultsMetadata withChapterSource(Optional<String> chapterSource) {
        Utils.checkNotNull(chapterSource, "chapterSource");
        this.chapterSource = chapterSource;
        return this;
    }

    public GetSearchResultsMetadata withPrimaryExtraKey(String primaryExtraKey) {
        Utils.checkNotNull(primaryExtraKey, "primaryExtraKey");
        this.primaryExtraKey = Optional.ofNullable(primaryExtraKey);
        return this;
    }

    public GetSearchResultsMetadata withPrimaryExtraKey(Optional<String> primaryExtraKey) {
        Utils.checkNotNull(primaryExtraKey, "primaryExtraKey");
        this.primaryExtraKey = primaryExtraKey;
        return this;
    }

    public GetSearchResultsMetadata withRatingImage(String ratingImage) {
        Utils.checkNotNull(ratingImage, "ratingImage");
        this.ratingImage = Optional.ofNullable(ratingImage);
        return this;
    }

    public GetSearchResultsMetadata withRatingImage(Optional<String> ratingImage) {
        Utils.checkNotNull(ratingImage, "ratingImage");
        this.ratingImage = ratingImage;
        return this;
    }

    public GetSearchResultsMetadata withMedia(List<GetSearchResultsMedia> media) {
        Utils.checkNotNull(media, "media");
        this.media = Optional.ofNullable(media);
        return this;
    }

    public GetSearchResultsMetadata withMedia(Optional<? extends List<GetSearchResultsMedia>> media) {
        Utils.checkNotNull(media, "media");
        this.media = media;
        return this;
    }

    public GetSearchResultsMetadata withGenre(List<GetSearchResultsGenre> genre) {
        Utils.checkNotNull(genre, "genre");
        this.genre = Optional.ofNullable(genre);
        return this;
    }

    public GetSearchResultsMetadata withGenre(Optional<? extends List<GetSearchResultsGenre>> genre) {
        Utils.checkNotNull(genre, "genre");
        this.genre = genre;
        return this;
    }

    public GetSearchResultsMetadata withDirector(List<GetSearchResultsDirector> director) {
        Utils.checkNotNull(director, "director");
        this.director = Optional.ofNullable(director);
        return this;
    }

    public GetSearchResultsMetadata withDirector(Optional<? extends List<GetSearchResultsDirector>> director) {
        Utils.checkNotNull(director, "director");
        this.director = director;
        return this;
    }

    public GetSearchResultsMetadata withWriter(List<GetSearchResultsWriter> writer) {
        Utils.checkNotNull(writer, "writer");
        this.writer = Optional.ofNullable(writer);
        return this;
    }

    public GetSearchResultsMetadata withWriter(Optional<? extends List<GetSearchResultsWriter>> writer) {
        Utils.checkNotNull(writer, "writer");
        this.writer = writer;
        return this;
    }

    public GetSearchResultsMetadata withCountry(List<GetSearchResultsCountry> country) {
        Utils.checkNotNull(country, "country");
        this.country = Optional.ofNullable(country);
        return this;
    }

    public GetSearchResultsMetadata withCountry(Optional<? extends List<GetSearchResultsCountry>> country) {
        Utils.checkNotNull(country, "country");
        this.country = country;
        return this;
    }

    public GetSearchResultsMetadata withRole(List<GetSearchResultsRole> role) {
        Utils.checkNotNull(role, "role");
        this.role = Optional.ofNullable(role);
        return this;
    }

    public GetSearchResultsMetadata withRole(Optional<? extends List<GetSearchResultsRole>> role) {
        Utils.checkNotNull(role, "role");
        this.role = role;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetSearchResultsMetadata other = (GetSearchResultsMetadata) o;
        return 
            Objects.deepEquals(this.allowSync, other.allowSync) &&
            Objects.deepEquals(this.librarySectionID, other.librarySectionID) &&
            Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) &&
            Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) &&
            Objects.deepEquals(this.personal, other.personal) &&
            Objects.deepEquals(this.sourceTitle, other.sourceTitle) &&
            Objects.deepEquals(this.ratingKey, other.ratingKey) &&
            Objects.deepEquals(this.key, other.key) &&
            Objects.deepEquals(this.guid, other.guid) &&
            Objects.deepEquals(this.studio, other.studio) &&
            Objects.deepEquals(this.type, other.type) &&
            Objects.deepEquals(this.title, other.title) &&
            Objects.deepEquals(this.contentRating, other.contentRating) &&
            Objects.deepEquals(this.summary, other.summary) &&
            Objects.deepEquals(this.rating, other.rating) &&
            Objects.deepEquals(this.audienceRating, other.audienceRating) &&
            Objects.deepEquals(this.year, other.year) &&
            Objects.deepEquals(this.tagline, other.tagline) &&
            Objects.deepEquals(this.thumb, other.thumb) &&
            Objects.deepEquals(this.art, other.art) &&
            Objects.deepEquals(this.duration, other.duration) &&
            Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) &&
            Objects.deepEquals(this.addedAt, other.addedAt) &&
            Objects.deepEquals(this.updatedAt, other.updatedAt) &&
            Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) &&
            Objects.deepEquals(this.chapterSource, other.chapterSource) &&
            Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) &&
            Objects.deepEquals(this.ratingImage, other.ratingImage) &&
            Objects.deepEquals(this.media, other.media) &&
            Objects.deepEquals(this.genre, other.genre) &&
            Objects.deepEquals(this.director, other.director) &&
            Objects.deepEquals(this.writer, other.writer) &&
            Objects.deepEquals(this.country, other.country) &&
            Objects.deepEquals(this.role, other.role);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            allowSync,
            librarySectionID,
            librarySectionTitle,
            librarySectionUUID,
            personal,
            sourceTitle,
            ratingKey,
            key,
            guid,
            studio,
            type,
            title,
            contentRating,
            summary,
            rating,
            audienceRating,
            year,
            tagline,
            thumb,
            art,
            duration,
            originallyAvailableAt,
            addedAt,
            updatedAt,
            audienceRatingImage,
            chapterSource,
            primaryExtraKey,
            ratingImage,
            media,
            genre,
            director,
            writer,
            country,
            role);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetSearchResultsMetadata.class,
                "allowSync", allowSync,
                "librarySectionID", librarySectionID,
                "librarySectionTitle", librarySectionTitle,
                "librarySectionUUID", librarySectionUUID,
                "personal", personal,
                "sourceTitle", sourceTitle,
                "ratingKey", ratingKey,
                "key", key,
                "guid", guid,
                "studio", studio,
                "type", type,
                "title", title,
                "contentRating", contentRating,
                "summary", summary,
                "rating", rating,
                "audienceRating", audienceRating,
                "year", year,
                "tagline", tagline,
                "thumb", thumb,
                "art", art,
                "duration", duration,
                "originallyAvailableAt", originallyAvailableAt,
                "addedAt", addedAt,
                "updatedAt", updatedAt,
                "audienceRatingImage", audienceRatingImage,
                "chapterSource", chapterSource,
                "primaryExtraKey", primaryExtraKey,
                "ratingImage", ratingImage,
                "media", media,
                "genre", genre,
                "director", director,
                "writer", writer,
                "country", country,
                "role", role);
    }
    
    public final static class Builder {
 
        private Optional<Boolean> allowSync = Optional.empty();
 
        private Optional<Double> librarySectionID = Optional.empty();
 
        private Optional<String> librarySectionTitle = Optional.empty();
 
        private Optional<String> librarySectionUUID = Optional.empty();
 
        private Optional<Boolean> personal = Optional.empty();
 
        private Optional<String> sourceTitle = Optional.empty();
 
        private Optional<Double> ratingKey = Optional.empty();
 
        private Optional<String> key = Optional.empty();
 
        private Optional<String> guid = Optional.empty();
 
        private Optional<String> studio = Optional.empty();
 
        private Optional<String> type = Optional.empty();
 
        private Optional<String> title = Optional.empty();
 
        private Optional<String> contentRating = Optional.empty();
 
        private Optional<String> summary = Optional.empty();
 
        private Optional<Double> rating = Optional.empty();
 
        private Optional<Double> audienceRating = Optional.empty();
 
        private Optional<Double> year = Optional.empty();
 
        private Optional<String> tagline = Optional.empty();
 
        private Optional<String> thumb = Optional.empty();
 
        private Optional<String> art = Optional.empty();
 
        private Optional<Double> duration = Optional.empty();
 
        private Optional<OffsetDateTime> originallyAvailableAt = Optional.empty();
 
        private Optional<Double> addedAt = Optional.empty();
 
        private Optional<Double> updatedAt = Optional.empty();
 
        private Optional<String> audienceRatingImage = Optional.empty();
 
        private Optional<String> chapterSource = Optional.empty();
 
        private Optional<String> primaryExtraKey = Optional.empty();
 
        private Optional<String> ratingImage = Optional.empty();
 
        private Optional<? extends List<GetSearchResultsMedia>> media = Optional.empty();
 
        private Optional<? extends List<GetSearchResultsGenre>> genre = Optional.empty();
 
        private Optional<? extends List<GetSearchResultsDirector>> director = Optional.empty();
 
        private Optional<? extends List<GetSearchResultsWriter>> writer = Optional.empty();
 
        private Optional<? extends List<GetSearchResultsCountry>> country = Optional.empty();
 
        private Optional<? extends List<GetSearchResultsRole>> role = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public Builder media(List<GetSearchResultsMedia> media) {
            Utils.checkNotNull(media, "media");
            this.media = Optional.ofNullable(media);
            return this;
        }

        public Builder media(Optional<? extends List<GetSearchResultsMedia>> media) {
            Utils.checkNotNull(media, "media");
            this.media = media;
            return this;
        }

        public Builder genre(List<GetSearchResultsGenre> genre) {
            Utils.checkNotNull(genre, "genre");
            this.genre = Optional.ofNullable(genre);
            return this;
        }

        public Builder genre(Optional<? extends List<GetSearchResultsGenre>> genre) {
            Utils.checkNotNull(genre, "genre");
            this.genre = genre;
            return this;
        }

        public Builder director(List<GetSearchResultsDirector> director) {
            Utils.checkNotNull(director, "director");
            this.director = Optional.ofNullable(director);
            return this;
        }

        public Builder director(Optional<? extends List<GetSearchResultsDirector>> director) {
            Utils.checkNotNull(director, "director");
            this.director = director;
            return this;
        }

        public Builder writer(List<GetSearchResultsWriter> writer) {
            Utils.checkNotNull(writer, "writer");
            this.writer = Optional.ofNullable(writer);
            return this;
        }

        public Builder writer(Optional<? extends List<GetSearchResultsWriter>> writer) {
            Utils.checkNotNull(writer, "writer");
            this.writer = writer;
            return this;
        }

        public Builder country(List<GetSearchResultsCountry> country) {
            Utils.checkNotNull(country, "country");
            this.country = Optional.ofNullable(country);
            return this;
        }

        public Builder country(Optional<? extends List<GetSearchResultsCountry>> country) {
            Utils.checkNotNull(country, "country");
            this.country = country;
            return this;
        }

        public Builder role(List<GetSearchResultsRole> role) {
            Utils.checkNotNull(role, "role");
            this.role = Optional.ofNullable(role);
            return this;
        }

        public Builder role(Optional<? extends List<GetSearchResultsRole>> role) {
            Utils.checkNotNull(role, "role");
            this.role = role;
            return this;
        }
        
        public GetSearchResultsMetadata build() {
            return new GetSearchResultsMetadata(
                allowSync,
                librarySectionID,
                librarySectionTitle,
                librarySectionUUID,
                personal,
                sourceTitle,
                ratingKey,
                key,
                guid,
                studio,
                type,
                title,
                contentRating,
                summary,
                rating,
                audienceRating,
                year,
                tagline,
                thumb,
                art,
                duration,
                originallyAvailableAt,
                addedAt,
                updatedAt,
                audienceRatingImage,
                chapterSource,
                primaryExtraKey,
                ratingImage,
                media,
                genre,
                director,
                writer,
                country,
                role);
        }
    }
}

