/* 
 * 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 GetCountriesLibraryMediaContainer {

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

    /**
     * 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 prefix used for media tag resource paths.
     */
    @JsonProperty("mediaTagPrefix")
    private String mediaTagPrefix;

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

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

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

    /**
     * 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;

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

    @JsonCreator
    public GetCountriesLibraryMediaContainer(
            @JsonProperty("size") int size,
            @JsonProperty("allowSync") boolean allowSync,
            @JsonProperty("art") String art,
            @JsonProperty("content") String content,
            @JsonProperty("identifier") String identifier,
            @JsonProperty("mediaTagPrefix") String mediaTagPrefix,
            @JsonProperty("mediaTagVersion") long mediaTagVersion,
            @JsonProperty("nocache") boolean nocache,
            @JsonProperty("thumb") String thumb,
            @JsonProperty("title1") String title1,
            @JsonProperty("title2") String title2,
            @JsonProperty("viewGroup") String viewGroup,
            @JsonProperty("Directory") Optional<? extends List<GetCountriesLibraryDirectory>> directory) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(allowSync, "allowSync");
        Utils.checkNotNull(art, "art");
        Utils.checkNotNull(content, "content");
        Utils.checkNotNull(identifier, "identifier");
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        Utils.checkNotNull(nocache, "nocache");
        Utils.checkNotNull(thumb, "thumb");
        Utils.checkNotNull(title1, "title1");
        Utils.checkNotNull(title2, "title2");
        Utils.checkNotNull(viewGroup, "viewGroup");
        Utils.checkNotNull(directory, "directory");
        this.size = size;
        this.allowSync = allowSync;
        this.art = art;
        this.content = content;
        this.identifier = identifier;
        this.mediaTagPrefix = mediaTagPrefix;
        this.mediaTagVersion = mediaTagVersion;
        this.nocache = nocache;
        this.thumb = thumb;
        this.title1 = title1;
        this.title2 = title2;
        this.viewGroup = viewGroup;
        this.directory = directory;
    }
    
    public GetCountriesLibraryMediaContainer(
            int size,
            boolean allowSync,
            String art,
            String content,
            String identifier,
            String mediaTagPrefix,
            long mediaTagVersion,
            boolean nocache,
            String thumb,
            String title1,
            String title2,
            String viewGroup) {
        this(size, allowSync, art, content, identifier, mediaTagPrefix, mediaTagVersion, nocache, thumb, title1, title2, viewGroup, Optional.empty());
    }

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

    /**
     * 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 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;
    }

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

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

    /**
     * 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;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public GetCountriesLibraryMediaContainer withDirectory(Optional<? extends List<GetCountriesLibraryDirectory>> directory) {
        Utils.checkNotNull(directory, "directory");
        this.directory = directory;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetCountriesLibraryMediaContainer other = (GetCountriesLibraryMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            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.mediaTagPrefix, other.mediaTagPrefix) &&
            Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
            Objects.deepEquals(this.nocache, other.nocache) &&
            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.directory, other.directory);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            allowSync,
            art,
            content,
            identifier,
            mediaTagPrefix,
            mediaTagVersion,
            nocache,
            thumb,
            title1,
            title2,
            viewGroup,
            directory);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetCountriesLibraryMediaContainer.class,
                "size", size,
                "allowSync", allowSync,
                "art", art,
                "content", content,
                "identifier", identifier,
                "mediaTagPrefix", mediaTagPrefix,
                "mediaTagVersion", mediaTagVersion,
                "nocache", nocache,
                "thumb", thumb,
                "title1", title1,
                "title2", title2,
                "viewGroup", viewGroup,
                "directory", directory);
    }
    
    public final static class Builder {
 
        private Integer size;
 
        private Boolean allowSync;
 
        private String art;
 
        private String content;
 
        private String identifier;
 
        private String mediaTagPrefix;
 
        private Long mediaTagVersion;
 
        private Boolean nocache;
 
        private String thumb;
 
        private String title1;
 
        private String title2;
 
        private String viewGroup;
 
        private Optional<? extends List<GetCountriesLibraryDirectory>> directory = 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;
        }

        /**
         * 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 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;
        }

        /**
         * Specifies whether caching is disabled.
         */
        public Builder nocache(boolean nocache) {
            Utils.checkNotNull(nocache, "nocache");
            this.nocache = nocache;
            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;
        }

        /**
         * 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;
        }

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

        public Builder directory(Optional<? extends List<GetCountriesLibraryDirectory>> directory) {
            Utils.checkNotNull(directory, "directory");
            this.directory = directory;
            return this;
        }
        
        public GetCountriesLibraryMediaContainer build() {
            return new GetCountriesLibraryMediaContainer(
                size,
                allowSync,
                art,
                content,
                identifier,
                mediaTagPrefix,
                mediaTagVersion,
                nocache,
                thumb,
                title1,
                title2,
                viewGroup,
                directory);
        }
    }
}

