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


public class GetMetadataChildrenMediaContainer {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("size")
    private Optional<Integer> size;

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

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("librarySectionID")
    private Optional<Integer> 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("mediaTagPrefix")
    private Optional<String> mediaTagPrefix;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("mediaTagVersion")
    private Optional<Integer> mediaTagVersion;

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("parentIndex")
    private Optional<Integer> parentIndex;

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("parentYear")
    private Optional<Integer> parentYear;

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

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

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

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("viewMode")
    private Optional<Integer> viewMode;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Directory")
    private Optional<? extends List<GetMetadataChildrenDirectory>> directory;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Metadata")
    private Optional<? extends List<GetMetadataChildrenMetadata>> metadata;

    @JsonCreator
    public GetMetadataChildrenMediaContainer(
            @JsonProperty("size") Optional<Integer> size,
            @JsonProperty("allowSync") Optional<Boolean> allowSync,
            @JsonProperty("art") Optional<String> art,
            @JsonProperty("identifier") Optional<String> identifier,
            @JsonProperty("key") Optional<String> key,
            @JsonProperty("librarySectionID") Optional<Integer> librarySectionID,
            @JsonProperty("librarySectionTitle") Optional<String> librarySectionTitle,
            @JsonProperty("librarySectionUUID") Optional<String> librarySectionUUID,
            @JsonProperty("mediaTagPrefix") Optional<String> mediaTagPrefix,
            @JsonProperty("mediaTagVersion") Optional<Integer> mediaTagVersion,
            @JsonProperty("nocache") Optional<Boolean> nocache,
            @JsonProperty("parentIndex") Optional<Integer> parentIndex,
            @JsonProperty("parentTitle") Optional<String> parentTitle,
            @JsonProperty("parentYear") Optional<Integer> parentYear,
            @JsonProperty("summary") Optional<String> summary,
            @JsonProperty("theme") Optional<String> theme,
            @JsonProperty("thumb") Optional<String> thumb,
            @JsonProperty("title1") Optional<String> title1,
            @JsonProperty("title2") Optional<String> title2,
            @JsonProperty("viewGroup") Optional<String> viewGroup,
            @JsonProperty("viewMode") Optional<Integer> viewMode,
            @JsonProperty("Directory") Optional<? extends List<GetMetadataChildrenDirectory>> directory,
            @JsonProperty("Metadata") Optional<? extends List<GetMetadataChildrenMetadata>> metadata) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(allowSync, "allowSync");
        Utils.checkNotNull(art, "art");
        Utils.checkNotNull(identifier, "identifier");
        Utils.checkNotNull(key, "key");
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        Utils.checkNotNull(nocache, "nocache");
        Utils.checkNotNull(parentIndex, "parentIndex");
        Utils.checkNotNull(parentTitle, "parentTitle");
        Utils.checkNotNull(parentYear, "parentYear");
        Utils.checkNotNull(summary, "summary");
        Utils.checkNotNull(theme, "theme");
        Utils.checkNotNull(thumb, "thumb");
        Utils.checkNotNull(title1, "title1");
        Utils.checkNotNull(title2, "title2");
        Utils.checkNotNull(viewGroup, "viewGroup");
        Utils.checkNotNull(viewMode, "viewMode");
        Utils.checkNotNull(directory, "directory");
        Utils.checkNotNull(metadata, "metadata");
        this.size = size;
        this.allowSync = allowSync;
        this.art = art;
        this.identifier = identifier;
        this.key = key;
        this.librarySectionID = librarySectionID;
        this.librarySectionTitle = librarySectionTitle;
        this.librarySectionUUID = librarySectionUUID;
        this.mediaTagPrefix = mediaTagPrefix;
        this.mediaTagVersion = mediaTagVersion;
        this.nocache = nocache;
        this.parentIndex = parentIndex;
        this.parentTitle = parentTitle;
        this.parentYear = parentYear;
        this.summary = summary;
        this.theme = theme;
        this.thumb = thumb;
        this.title1 = title1;
        this.title2 = title2;
        this.viewGroup = viewGroup;
        this.viewMode = viewMode;
        this.directory = directory;
        this.metadata = metadata;
    }
    
    public GetMetadataChildrenMediaContainer() {
        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());
    }

    @JsonIgnore
    public Optional<Integer> size() {
        return size;
    }

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

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

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

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

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

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

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

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

    @JsonIgnore
    public Optional<Integer> mediaTagVersion() {
        return mediaTagVersion;
    }

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

    @JsonIgnore
    public Optional<Integer> parentIndex() {
        return parentIndex;
    }

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

    @JsonIgnore
    public Optional<Integer> parentYear() {
        return parentYear;
    }

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

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

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

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

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

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

    @JsonIgnore
    public Optional<Integer> viewMode() {
        return viewMode;
    }

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

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

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

    public GetMetadataChildrenMediaContainer withSize(int size) {
        Utils.checkNotNull(size, "size");
        this.size = Optional.ofNullable(size);
        return this;
    }

    public GetMetadataChildrenMediaContainer withSize(Optional<Integer> size) {
        Utils.checkNotNull(size, "size");
        this.size = size;
        return this;
    }

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

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

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

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

    public GetMetadataChildrenMediaContainer withIdentifier(String identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = Optional.ofNullable(identifier);
        return this;
    }

    public GetMetadataChildrenMediaContainer withIdentifier(Optional<String> identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = identifier;
        return this;
    }

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

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

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

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

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

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

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

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

    public GetMetadataChildrenMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix);
        return this;
    }

    public GetMetadataChildrenMediaContainer withMediaTagPrefix(Optional<String> mediaTagPrefix) {
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        this.mediaTagPrefix = mediaTagPrefix;
        return this;
    }

    public GetMetadataChildrenMediaContainer withMediaTagVersion(int mediaTagVersion) {
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        this.mediaTagVersion = Optional.ofNullable(mediaTagVersion);
        return this;
    }

    public GetMetadataChildrenMediaContainer withMediaTagVersion(Optional<Integer> mediaTagVersion) {
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        this.mediaTagVersion = mediaTagVersion;
        return this;
    }

    public GetMetadataChildrenMediaContainer withNocache(boolean nocache) {
        Utils.checkNotNull(nocache, "nocache");
        this.nocache = Optional.ofNullable(nocache);
        return this;
    }

    public GetMetadataChildrenMediaContainer withNocache(Optional<Boolean> nocache) {
        Utils.checkNotNull(nocache, "nocache");
        this.nocache = nocache;
        return this;
    }

    public GetMetadataChildrenMediaContainer withParentIndex(int parentIndex) {
        Utils.checkNotNull(parentIndex, "parentIndex");
        this.parentIndex = Optional.ofNullable(parentIndex);
        return this;
    }

    public GetMetadataChildrenMediaContainer withParentIndex(Optional<Integer> parentIndex) {
        Utils.checkNotNull(parentIndex, "parentIndex");
        this.parentIndex = parentIndex;
        return this;
    }

    public GetMetadataChildrenMediaContainer withParentTitle(String parentTitle) {
        Utils.checkNotNull(parentTitle, "parentTitle");
        this.parentTitle = Optional.ofNullable(parentTitle);
        return this;
    }

    public GetMetadataChildrenMediaContainer withParentTitle(Optional<String> parentTitle) {
        Utils.checkNotNull(parentTitle, "parentTitle");
        this.parentTitle = parentTitle;
        return this;
    }

    public GetMetadataChildrenMediaContainer withParentYear(int parentYear) {
        Utils.checkNotNull(parentYear, "parentYear");
        this.parentYear = Optional.ofNullable(parentYear);
        return this;
    }

    public GetMetadataChildrenMediaContainer withParentYear(Optional<Integer> parentYear) {
        Utils.checkNotNull(parentYear, "parentYear");
        this.parentYear = parentYear;
        return this;
    }

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

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

    public GetMetadataChildrenMediaContainer withTheme(String theme) {
        Utils.checkNotNull(theme, "theme");
        this.theme = Optional.ofNullable(theme);
        return this;
    }

    public GetMetadataChildrenMediaContainer withTheme(Optional<String> theme) {
        Utils.checkNotNull(theme, "theme");
        this.theme = theme;
        return this;
    }

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

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

    public GetMetadataChildrenMediaContainer withTitle1(String title1) {
        Utils.checkNotNull(title1, "title1");
        this.title1 = Optional.ofNullable(title1);
        return this;
    }

    public GetMetadataChildrenMediaContainer withTitle1(Optional<String> title1) {
        Utils.checkNotNull(title1, "title1");
        this.title1 = title1;
        return this;
    }

    public GetMetadataChildrenMediaContainer withTitle2(String title2) {
        Utils.checkNotNull(title2, "title2");
        this.title2 = Optional.ofNullable(title2);
        return this;
    }

    public GetMetadataChildrenMediaContainer withTitle2(Optional<String> title2) {
        Utils.checkNotNull(title2, "title2");
        this.title2 = title2;
        return this;
    }

    public GetMetadataChildrenMediaContainer withViewGroup(String viewGroup) {
        Utils.checkNotNull(viewGroup, "viewGroup");
        this.viewGroup = Optional.ofNullable(viewGroup);
        return this;
    }

    public GetMetadataChildrenMediaContainer withViewGroup(Optional<String> viewGroup) {
        Utils.checkNotNull(viewGroup, "viewGroup");
        this.viewGroup = viewGroup;
        return this;
    }

    public GetMetadataChildrenMediaContainer withViewMode(int viewMode) {
        Utils.checkNotNull(viewMode, "viewMode");
        this.viewMode = Optional.ofNullable(viewMode);
        return this;
    }

    public GetMetadataChildrenMediaContainer withViewMode(Optional<Integer> viewMode) {
        Utils.checkNotNull(viewMode, "viewMode");
        this.viewMode = viewMode;
        return this;
    }

    public GetMetadataChildrenMediaContainer withDirectory(List<GetMetadataChildrenDirectory> directory) {
        Utils.checkNotNull(directory, "directory");
        this.directory = Optional.ofNullable(directory);
        return this;
    }

    public GetMetadataChildrenMediaContainer withDirectory(Optional<? extends List<GetMetadataChildrenDirectory>> directory) {
        Utils.checkNotNull(directory, "directory");
        this.directory = directory;
        return this;
    }

    public GetMetadataChildrenMediaContainer withMetadata(List<GetMetadataChildrenMetadata> metadata) {
        Utils.checkNotNull(metadata, "metadata");
        this.metadata = Optional.ofNullable(metadata);
        return this;
    }

    public GetMetadataChildrenMediaContainer withMetadata(Optional<? extends List<GetMetadataChildrenMetadata>> metadata) {
        Utils.checkNotNull(metadata, "metadata");
        this.metadata = metadata;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetMetadataChildrenMediaContainer other = (GetMetadataChildrenMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.allowSync, other.allowSync) &&
            Objects.deepEquals(this.art, other.art) &&
            Objects.deepEquals(this.identifier, other.identifier) &&
            Objects.deepEquals(this.key, other.key) &&
            Objects.deepEquals(this.librarySectionID, other.librarySectionID) &&
            Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) &&
            Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) &&
            Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) &&
            Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
            Objects.deepEquals(this.nocache, other.nocache) &&
            Objects.deepEquals(this.parentIndex, other.parentIndex) &&
            Objects.deepEquals(this.parentTitle, other.parentTitle) &&
            Objects.deepEquals(this.parentYear, other.parentYear) &&
            Objects.deepEquals(this.summary, other.summary) &&
            Objects.deepEquals(this.theme, other.theme) &&
            Objects.deepEquals(this.thumb, other.thumb) &&
            Objects.deepEquals(this.title1, other.title1) &&
            Objects.deepEquals(this.title2, other.title2) &&
            Objects.deepEquals(this.viewGroup, other.viewGroup) &&
            Objects.deepEquals(this.viewMode, other.viewMode) &&
            Objects.deepEquals(this.directory, other.directory) &&
            Objects.deepEquals(this.metadata, other.metadata);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            allowSync,
            art,
            identifier,
            key,
            librarySectionID,
            librarySectionTitle,
            librarySectionUUID,
            mediaTagPrefix,
            mediaTagVersion,
            nocache,
            parentIndex,
            parentTitle,
            parentYear,
            summary,
            theme,
            thumb,
            title1,
            title2,
            viewGroup,
            viewMode,
            directory,
            metadata);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetMetadataChildrenMediaContainer.class,
                "size", size,
                "allowSync", allowSync,
                "art", art,
                "identifier", identifier,
                "key", key,
                "librarySectionID", librarySectionID,
                "librarySectionTitle", librarySectionTitle,
                "librarySectionUUID", librarySectionUUID,
                "mediaTagPrefix", mediaTagPrefix,
                "mediaTagVersion", mediaTagVersion,
                "nocache", nocache,
                "parentIndex", parentIndex,
                "parentTitle", parentTitle,
                "parentYear", parentYear,
                "summary", summary,
                "theme", theme,
                "thumb", thumb,
                "title1", title1,
                "title2", title2,
                "viewGroup", viewGroup,
                "viewMode", viewMode,
                "directory", directory,
                "metadata", metadata);
    }
    
    public final static class Builder {
 
        private Optional<Integer> size = Optional.empty();
 
        private Optional<Boolean> allowSync = Optional.empty();
 
        private Optional<String> art = Optional.empty();
 
        private Optional<String> identifier = Optional.empty();
 
        private Optional<String> key = Optional.empty();
 
        private Optional<Integer> librarySectionID = Optional.empty();
 
        private Optional<String> librarySectionTitle = Optional.empty();
 
        private Optional<String> librarySectionUUID = Optional.empty();
 
        private Optional<String> mediaTagPrefix = Optional.empty();
 
        private Optional<Integer> mediaTagVersion = Optional.empty();
 
        private Optional<Boolean> nocache = Optional.empty();
 
        private Optional<Integer> parentIndex = Optional.empty();
 
        private Optional<String> parentTitle = Optional.empty();
 
        private Optional<Integer> parentYear = Optional.empty();
 
        private Optional<String> summary = Optional.empty();
 
        private Optional<String> theme = Optional.empty();
 
        private Optional<String> thumb = Optional.empty();
 
        private Optional<String> title1 = Optional.empty();
 
        private Optional<String> title2 = Optional.empty();
 
        private Optional<String> viewGroup = Optional.empty();
 
        private Optional<Integer> viewMode = Optional.empty();
 
        private Optional<? extends List<GetMetadataChildrenDirectory>> directory = Optional.empty();
 
        private Optional<? extends List<GetMetadataChildrenMetadata>> metadata = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

        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 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 identifier(String identifier) {
            Utils.checkNotNull(identifier, "identifier");
            this.identifier = Optional.ofNullable(identifier);
            return this;
        }

        public Builder identifier(Optional<String> identifier) {
            Utils.checkNotNull(identifier, "identifier");
            this.identifier = identifier;
            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 librarySectionID(int librarySectionID) {
            Utils.checkNotNull(librarySectionID, "librarySectionID");
            this.librarySectionID = Optional.ofNullable(librarySectionID);
            return this;
        }

        public Builder librarySectionID(Optional<Integer> 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 mediaTagPrefix(String mediaTagPrefix) {
            Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
            this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix);
            return this;
        }

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

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

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

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

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

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

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

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

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

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

        public Builder parentYear(Optional<Integer> parentYear) {
            Utils.checkNotNull(parentYear, "parentYear");
            this.parentYear = parentYear;
            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 theme(String theme) {
            Utils.checkNotNull(theme, "theme");
            this.theme = Optional.ofNullable(theme);
            return this;
        }

        public Builder theme(Optional<String> theme) {
            Utils.checkNotNull(theme, "theme");
            this.theme = theme;
            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 title1(String title1) {
            Utils.checkNotNull(title1, "title1");
            this.title1 = Optional.ofNullable(title1);
            return this;
        }

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

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

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

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

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

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

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

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

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

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

        public Builder metadata(Optional<? extends List<GetMetadataChildrenMetadata>> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = metadata;
            return this;
        }
        
        public GetMetadataChildrenMediaContainer build() {
            return new GetMetadataChildrenMediaContainer(
                size,
                allowSync,
                art,
                identifier,
                key,
                librarySectionID,
                librarySectionTitle,
                librarySectionUUID,
                mediaTagPrefix,
                mediaTagVersion,
                nocache,
                parentIndex,
                parentTitle,
                parentYear,
                summary,
                theme,
                thumb,
                title1,
                title2,
                viewGroup,
                viewMode,
                directory,
                metadata);
        }
    }
}

