/* 
 * 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.Long;
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 GetAllMediaLibraryMediaContainer {

    /**
     * Number of media items returned in this response.
     */
    @JsonProperty("size")
    private int size;

    /**
     * Total number of media items in the library.
     */
    @JsonProperty("totalSize")
    private int totalSize;

    /**
     * Offset value for pagination.
     */
    @JsonProperty("offset")
    private long offset;

    /**
     * Indicates whether syncing is allowed.
     */
    @JsonProperty("allowSync")
    private boolean allowSync;

    /**
     * URL for the background artwork of the media container.
     */
    @JsonProperty("art")
    private String art;

    /**
     * The content type or mode.
     */
    @JsonProperty("content")
    private String content;

    /**
     * An plugin identifier for the media container.
     */
    @JsonProperty("identifier")
    private String identifier;

    /**
     * The unique identifier for the library section.
     */
    @JsonProperty("librarySectionID")
    private long librarySectionID;

    /**
     * The title of the library section.
     */
    @JsonProperty("librarySectionTitle")
    private String librarySectionTitle;

    /**
     * The universally unique identifier for the library section.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("librarySectionUUID")
    private Optional<String> librarySectionUUID;

    /**
     * The prefix used for media tag resource paths.
     */
    @JsonProperty("mediaTagPrefix")
    private String mediaTagPrefix;

    /**
     * The version number for media tags.
     */
    @JsonProperty("mediaTagVersion")
    private long mediaTagVersion;

    /**
     * URL for the thumbnail image of the media container.
     */
    @JsonProperty("thumb")
    private String thumb;

    /**
     * Specifies whether caching is disabled.
     */
    @JsonProperty("nocache")
    private boolean nocache;

    /**
     * The primary title of the media container.
     */
    @JsonProperty("title1")
    private String title1;

    /**
     * The secondary title of the media container.
     */
    @JsonProperty("title2")
    private String title2;

    /**
     * Identifier for the view group layout.
     */
    @JsonProperty("viewGroup")
    private String viewGroup;

    /**
     * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
     * 
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Meta")
    private Optional<? extends GetAllMediaLibraryMeta> meta;

    /**
     * An array of metadata items.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Metadata")
    private Optional<? extends List<GetAllMediaLibraryMetadata>> metadata;

    @JsonCreator
    public GetAllMediaLibraryMediaContainer(
            @JsonProperty("size") int size,
            @JsonProperty("totalSize") int totalSize,
            @JsonProperty("offset") long offset,
            @JsonProperty("allowSync") boolean allowSync,
            @JsonProperty("art") String art,
            @JsonProperty("content") String content,
            @JsonProperty("identifier") String identifier,
            @JsonProperty("librarySectionID") long librarySectionID,
            @JsonProperty("librarySectionTitle") String librarySectionTitle,
            @JsonProperty("librarySectionUUID") Optional<String> librarySectionUUID,
            @JsonProperty("mediaTagPrefix") String mediaTagPrefix,
            @JsonProperty("mediaTagVersion") long mediaTagVersion,
            @JsonProperty("thumb") String thumb,
            @JsonProperty("nocache") boolean nocache,
            @JsonProperty("title1") String title1,
            @JsonProperty("title2") String title2,
            @JsonProperty("viewGroup") String viewGroup,
            @JsonProperty("Meta") Optional<? extends GetAllMediaLibraryMeta> meta,
            @JsonProperty("Metadata") Optional<? extends List<GetAllMediaLibraryMetadata>> metadata) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(totalSize, "totalSize");
        Utils.checkNotNull(offset, "offset");
        Utils.checkNotNull(allowSync, "allowSync");
        Utils.checkNotNull(art, "art");
        Utils.checkNotNull(content, "content");
        Utils.checkNotNull(identifier, "identifier");
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        Utils.checkNotNull(thumb, "thumb");
        Utils.checkNotNull(nocache, "nocache");
        Utils.checkNotNull(title1, "title1");
        Utils.checkNotNull(title2, "title2");
        Utils.checkNotNull(viewGroup, "viewGroup");
        Utils.checkNotNull(meta, "meta");
        Utils.checkNotNull(metadata, "metadata");
        this.size = size;
        this.totalSize = totalSize;
        this.offset = offset;
        this.allowSync = allowSync;
        this.art = art;
        this.content = content;
        this.identifier = identifier;
        this.librarySectionID = librarySectionID;
        this.librarySectionTitle = librarySectionTitle;
        this.librarySectionUUID = librarySectionUUID;
        this.mediaTagPrefix = mediaTagPrefix;
        this.mediaTagVersion = mediaTagVersion;
        this.thumb = thumb;
        this.nocache = nocache;
        this.title1 = title1;
        this.title2 = title2;
        this.viewGroup = viewGroup;
        this.meta = meta;
        this.metadata = metadata;
    }
    
    public GetAllMediaLibraryMediaContainer(
            int size,
            int totalSize,
            long offset,
            boolean allowSync,
            String art,
            String content,
            String identifier,
            long librarySectionID,
            String librarySectionTitle,
            String mediaTagPrefix,
            long mediaTagVersion,
            String thumb,
            boolean nocache,
            String title1,
            String title2,
            String viewGroup) {
        this(size, totalSize, offset, allowSync, art, content, identifier, librarySectionID, librarySectionTitle, Optional.empty(), mediaTagPrefix, mediaTagVersion, thumb, nocache, title1, title2, viewGroup, Optional.empty(), Optional.empty());
    }

    /**
     * Number of media items returned in this response.
     */
    @JsonIgnore
    public int size() {
        return size;
    }

    /**
     * Total number of media items in the library.
     */
    @JsonIgnore
    public int totalSize() {
        return totalSize;
    }

    /**
     * Offset value for pagination.
     */
    @JsonIgnore
    public long offset() {
        return offset;
    }

    /**
     * Indicates whether syncing is allowed.
     */
    @JsonIgnore
    public boolean allowSync() {
        return allowSync;
    }

    /**
     * URL for the background artwork of the media container.
     */
    @JsonIgnore
    public String art() {
        return art;
    }

    /**
     * The content type or mode.
     */
    @JsonIgnore
    public String content() {
        return content;
    }

    /**
     * An plugin identifier for the media container.
     */
    @JsonIgnore
    public String identifier() {
        return identifier;
    }

    /**
     * The unique identifier for the library section.
     */
    @JsonIgnore
    public long librarySectionID() {
        return librarySectionID;
    }

    /**
     * The title of the library section.
     */
    @JsonIgnore
    public String librarySectionTitle() {
        return librarySectionTitle;
    }

    /**
     * The universally unique identifier for the library section.
     */
    @JsonIgnore
    public Optional<String> librarySectionUUID() {
        return librarySectionUUID;
    }

    /**
     * The prefix used for media tag resource paths.
     */
    @JsonIgnore
    public String mediaTagPrefix() {
        return mediaTagPrefix;
    }

    /**
     * The version number for media tags.
     */
    @JsonIgnore
    public long mediaTagVersion() {
        return mediaTagVersion;
    }

    /**
     * URL for the thumbnail image of the media container.
     */
    @JsonIgnore
    public String thumb() {
        return thumb;
    }

    /**
     * Specifies whether caching is disabled.
     */
    @JsonIgnore
    public boolean nocache() {
        return nocache;
    }

    /**
     * The primary title of the media container.
     */
    @JsonIgnore
    public String title1() {
        return title1;
    }

    /**
     * The secondary title of the media container.
     */
    @JsonIgnore
    public String title2() {
        return title2;
    }

    /**
     * Identifier for the view group layout.
     */
    @JsonIgnore
    public String viewGroup() {
        return viewGroup;
    }

    /**
     * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
     * 
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<GetAllMediaLibraryMeta> meta() {
        return (Optional<GetAllMediaLibraryMeta>) meta;
    }

    /**
     * An array of metadata items.
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetAllMediaLibraryMetadata>> metadata() {
        return (Optional<List<GetAllMediaLibraryMetadata>>) metadata;
    }

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

    /**
     * Number of media items returned in this response.
     */
    public GetAllMediaLibraryMediaContainer withSize(int size) {
        Utils.checkNotNull(size, "size");
        this.size = size;
        return this;
    }

    /**
     * Total number of media items in the library.
     */
    public GetAllMediaLibraryMediaContainer withTotalSize(int totalSize) {
        Utils.checkNotNull(totalSize, "totalSize");
        this.totalSize = totalSize;
        return this;
    }

    /**
     * Offset value for pagination.
     */
    public GetAllMediaLibraryMediaContainer withOffset(long offset) {
        Utils.checkNotNull(offset, "offset");
        this.offset = offset;
        return this;
    }

    /**
     * Indicates whether syncing is allowed.
     */
    public GetAllMediaLibraryMediaContainer withAllowSync(boolean allowSync) {
        Utils.checkNotNull(allowSync, "allowSync");
        this.allowSync = allowSync;
        return this;
    }

    /**
     * URL for the background artwork of the media container.
     */
    public GetAllMediaLibraryMediaContainer withArt(String art) {
        Utils.checkNotNull(art, "art");
        this.art = art;
        return this;
    }

    /**
     * The content type or mode.
     */
    public GetAllMediaLibraryMediaContainer withContent(String content) {
        Utils.checkNotNull(content, "content");
        this.content = content;
        return this;
    }

    /**
     * An plugin identifier for the media container.
     */
    public GetAllMediaLibraryMediaContainer withIdentifier(String identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = identifier;
        return this;
    }

    /**
     * The unique identifier for the library section.
     */
    public GetAllMediaLibraryMediaContainer withLibrarySectionID(long librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = librarySectionID;
        return this;
    }

    /**
     * The title of the library section.
     */
    public GetAllMediaLibraryMediaContainer withLibrarySectionTitle(String librarySectionTitle) {
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        this.librarySectionTitle = librarySectionTitle;
        return this;
    }

    /**
     * The universally unique identifier for the library section.
     */
    public GetAllMediaLibraryMediaContainer withLibrarySectionUUID(String librarySectionUUID) {
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        this.librarySectionUUID = Optional.ofNullable(librarySectionUUID);
        return this;
    }

    /**
     * The universally unique identifier for the library section.
     */
    public GetAllMediaLibraryMediaContainer withLibrarySectionUUID(Optional<String> librarySectionUUID) {
        Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
        this.librarySectionUUID = librarySectionUUID;
        return this;
    }

    /**
     * The prefix used for media tag resource paths.
     */
    public GetAllMediaLibraryMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        this.mediaTagPrefix = mediaTagPrefix;
        return this;
    }

    /**
     * The version number for media tags.
     */
    public GetAllMediaLibraryMediaContainer withMediaTagVersion(long mediaTagVersion) {
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        this.mediaTagVersion = mediaTagVersion;
        return this;
    }

    /**
     * URL for the thumbnail image of the media container.
     */
    public GetAllMediaLibraryMediaContainer withThumb(String thumb) {
        Utils.checkNotNull(thumb, "thumb");
        this.thumb = thumb;
        return this;
    }

    /**
     * Specifies whether caching is disabled.
     */
    public GetAllMediaLibraryMediaContainer withNocache(boolean nocache) {
        Utils.checkNotNull(nocache, "nocache");
        this.nocache = nocache;
        return this;
    }

    /**
     * The primary title of the media container.
     */
    public GetAllMediaLibraryMediaContainer withTitle1(String title1) {
        Utils.checkNotNull(title1, "title1");
        this.title1 = title1;
        return this;
    }

    /**
     * The secondary title of the media container.
     */
    public GetAllMediaLibraryMediaContainer withTitle2(String title2) {
        Utils.checkNotNull(title2, "title2");
        this.title2 = title2;
        return this;
    }

    /**
     * Identifier for the view group layout.
     */
    public GetAllMediaLibraryMediaContainer withViewGroup(String viewGroup) {
        Utils.checkNotNull(viewGroup, "viewGroup");
        this.viewGroup = viewGroup;
        return this;
    }

    /**
     * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
     * 
     */
    public GetAllMediaLibraryMediaContainer withMeta(GetAllMediaLibraryMeta meta) {
        Utils.checkNotNull(meta, "meta");
        this.meta = Optional.ofNullable(meta);
        return this;
    }

    /**
     * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
     * 
     */
    public GetAllMediaLibraryMediaContainer withMeta(Optional<? extends GetAllMediaLibraryMeta> meta) {
        Utils.checkNotNull(meta, "meta");
        this.meta = meta;
        return this;
    }

    /**
     * An array of metadata items.
     */
    public GetAllMediaLibraryMediaContainer withMetadata(List<GetAllMediaLibraryMetadata> metadata) {
        Utils.checkNotNull(metadata, "metadata");
        this.metadata = Optional.ofNullable(metadata);
        return this;
    }

    /**
     * An array of metadata items.
     */
    public GetAllMediaLibraryMediaContainer withMetadata(Optional<? extends List<GetAllMediaLibraryMetadata>> 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;
        }
        GetAllMediaLibraryMediaContainer other = (GetAllMediaLibraryMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.totalSize, other.totalSize) &&
            Objects.deepEquals(this.offset, other.offset) &&
            Objects.deepEquals(this.allowSync, other.allowSync) &&
            Objects.deepEquals(this.art, other.art) &&
            Objects.deepEquals(this.content, other.content) &&
            Objects.deepEquals(this.identifier, other.identifier) &&
            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.thumb, other.thumb) &&
            Objects.deepEquals(this.nocache, other.nocache) &&
            Objects.deepEquals(this.title1, other.title1) &&
            Objects.deepEquals(this.title2, other.title2) &&
            Objects.deepEquals(this.viewGroup, other.viewGroup) &&
            Objects.deepEquals(this.meta, other.meta) &&
            Objects.deepEquals(this.metadata, other.metadata);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            totalSize,
            offset,
            allowSync,
            art,
            content,
            identifier,
            librarySectionID,
            librarySectionTitle,
            librarySectionUUID,
            mediaTagPrefix,
            mediaTagVersion,
            thumb,
            nocache,
            title1,
            title2,
            viewGroup,
            meta,
            metadata);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetAllMediaLibraryMediaContainer.class,
                "size", size,
                "totalSize", totalSize,
                "offset", offset,
                "allowSync", allowSync,
                "art", art,
                "content", content,
                "identifier", identifier,
                "librarySectionID", librarySectionID,
                "librarySectionTitle", librarySectionTitle,
                "librarySectionUUID", librarySectionUUID,
                "mediaTagPrefix", mediaTagPrefix,
                "mediaTagVersion", mediaTagVersion,
                "thumb", thumb,
                "nocache", nocache,
                "title1", title1,
                "title2", title2,
                "viewGroup", viewGroup,
                "meta", meta,
                "metadata", metadata);
    }
    
    public final static class Builder {
 
        private Integer size;
 
        private Integer totalSize;
 
        private Long offset;
 
        private Boolean allowSync;
 
        private String art;
 
        private String content;
 
        private String identifier;
 
        private Long librarySectionID;
 
        private String librarySectionTitle;
 
        private Optional<String> librarySectionUUID = Optional.empty();
 
        private String mediaTagPrefix;
 
        private Long mediaTagVersion;
 
        private String thumb;
 
        private Boolean nocache;
 
        private String title1;
 
        private String title2;
 
        private String viewGroup;
 
        private Optional<? extends GetAllMediaLibraryMeta> meta = Optional.empty();
 
        private Optional<? extends List<GetAllMediaLibraryMetadata>> metadata = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * Number of media items returned in this response.
         */
        public Builder size(int size) {
            Utils.checkNotNull(size, "size");
            this.size = size;
            return this;
        }

        /**
         * Total number of media items in the library.
         */
        public Builder totalSize(int totalSize) {
            Utils.checkNotNull(totalSize, "totalSize");
            this.totalSize = totalSize;
            return this;
        }

        /**
         * Offset value for pagination.
         */
        public Builder offset(long offset) {
            Utils.checkNotNull(offset, "offset");
            this.offset = offset;
            return this;
        }

        /**
         * Indicates whether syncing is allowed.
         */
        public Builder allowSync(boolean allowSync) {
            Utils.checkNotNull(allowSync, "allowSync");
            this.allowSync = allowSync;
            return this;
        }

        /**
         * URL for the background artwork of the media container.
         */
        public Builder art(String art) {
            Utils.checkNotNull(art, "art");
            this.art = art;
            return this;
        }

        /**
         * The content type or mode.
         */
        public Builder content(String content) {
            Utils.checkNotNull(content, "content");
            this.content = content;
            return this;
        }

        /**
         * An plugin identifier for the media container.
         */
        public Builder identifier(String identifier) {
            Utils.checkNotNull(identifier, "identifier");
            this.identifier = identifier;
            return this;
        }

        /**
         * The unique identifier for the library section.
         */
        public Builder librarySectionID(long librarySectionID) {
            Utils.checkNotNull(librarySectionID, "librarySectionID");
            this.librarySectionID = librarySectionID;
            return this;
        }

        /**
         * The title of the library section.
         */
        public Builder librarySectionTitle(String librarySectionTitle) {
            Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
            this.librarySectionTitle = librarySectionTitle;
            return this;
        }

        /**
         * The universally unique identifier for the library section.
         */
        public Builder librarySectionUUID(String librarySectionUUID) {
            Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
            this.librarySectionUUID = Optional.ofNullable(librarySectionUUID);
            return this;
        }

        /**
         * The universally unique identifier for the library section.
         */
        public Builder librarySectionUUID(Optional<String> librarySectionUUID) {
            Utils.checkNotNull(librarySectionUUID, "librarySectionUUID");
            this.librarySectionUUID = librarySectionUUID;
            return this;
        }

        /**
         * The prefix used for media tag resource paths.
         */
        public Builder mediaTagPrefix(String mediaTagPrefix) {
            Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
            this.mediaTagPrefix = mediaTagPrefix;
            return this;
        }

        /**
         * The version number for media tags.
         */
        public Builder mediaTagVersion(long mediaTagVersion) {
            Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
            this.mediaTagVersion = mediaTagVersion;
            return this;
        }

        /**
         * URL for the thumbnail image of the media container.
         */
        public Builder thumb(String thumb) {
            Utils.checkNotNull(thumb, "thumb");
            this.thumb = thumb;
            return this;
        }

        /**
         * Specifies whether caching is disabled.
         */
        public Builder nocache(boolean nocache) {
            Utils.checkNotNull(nocache, "nocache");
            this.nocache = nocache;
            return this;
        }

        /**
         * The primary title of the media container.
         */
        public Builder title1(String title1) {
            Utils.checkNotNull(title1, "title1");
            this.title1 = title1;
            return this;
        }

        /**
         * The secondary title of the media container.
         */
        public Builder title2(String title2) {
            Utils.checkNotNull(title2, "title2");
            this.title2 = title2;
            return this;
        }

        /**
         * Identifier for the view group layout.
         */
        public Builder viewGroup(String viewGroup) {
            Utils.checkNotNull(viewGroup, "viewGroup");
            this.viewGroup = viewGroup;
            return this;
        }

        /**
         * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
         * 
         */
        public Builder meta(GetAllMediaLibraryMeta meta) {
            Utils.checkNotNull(meta, "meta");
            this.meta = Optional.ofNullable(meta);
            return this;
        }

        /**
         * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
         * 
         */
        public Builder meta(Optional<? extends GetAllMediaLibraryMeta> meta) {
            Utils.checkNotNull(meta, "meta");
            this.meta = meta;
            return this;
        }

        /**
         * An array of metadata items.
         */
        public Builder metadata(List<GetAllMediaLibraryMetadata> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = Optional.ofNullable(metadata);
            return this;
        }

        /**
         * An array of metadata items.
         */
        public Builder metadata(Optional<? extends List<GetAllMediaLibraryMetadata>> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = metadata;
            return this;
        }
        
        public GetAllMediaLibraryMediaContainer build() {
            return new GetAllMediaLibraryMediaContainer(
                size,
                totalSize,
                offset,
                allowSync,
                art,
                content,
                identifier,
                librarySectionID,
                librarySectionTitle,
                librarySectionUUID,
                mediaTagPrefix,
                mediaTagVersion,
                thumb,
                nocache,
                title1,
                title2,
                viewGroup,
                meta,
                metadata);
        }
    }
}

