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

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

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

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

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

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

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

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

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

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

    @JsonCreator
    public GetPlaylistContentsMediaContainer(
            @JsonProperty("size") Optional<Integer> size,
            @JsonProperty("composite") Optional<String> composite,
            @JsonProperty("duration") Optional<Integer> duration,
            @JsonProperty("leafCount") Optional<Integer> leafCount,
            @JsonProperty("playlistType") Optional<String> playlistType,
            @JsonProperty("ratingKey") Optional<String> ratingKey,
            @JsonProperty("smart") Optional<Boolean> smart,
            @JsonProperty("title") Optional<String> title,
            @JsonProperty("Metadata") Optional<? extends List<GetPlaylistContentsMetadata>> metadata) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(composite, "composite");
        Utils.checkNotNull(duration, "duration");
        Utils.checkNotNull(leafCount, "leafCount");
        Utils.checkNotNull(playlistType, "playlistType");
        Utils.checkNotNull(ratingKey, "ratingKey");
        Utils.checkNotNull(smart, "smart");
        Utils.checkNotNull(title, "title");
        Utils.checkNotNull(metadata, "metadata");
        this.size = size;
        this.composite = composite;
        this.duration = duration;
        this.leafCount = leafCount;
        this.playlistType = playlistType;
        this.ratingKey = ratingKey;
        this.smart = smart;
        this.title = title;
        this.metadata = metadata;
    }
    
    public GetPlaylistContentsMediaContainer() {
        this(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<String> composite() {
        return composite;
    }

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

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

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

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

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

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

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

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

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

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

    public GetPlaylistContentsMediaContainer withComposite(String composite) {
        Utils.checkNotNull(composite, "composite");
        this.composite = Optional.ofNullable(composite);
        return this;
    }

    public GetPlaylistContentsMediaContainer withComposite(Optional<String> composite) {
        Utils.checkNotNull(composite, "composite");
        this.composite = composite;
        return this;
    }

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

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

    public GetPlaylistContentsMediaContainer withLeafCount(int leafCount) {
        Utils.checkNotNull(leafCount, "leafCount");
        this.leafCount = Optional.ofNullable(leafCount);
        return this;
    }

    public GetPlaylistContentsMediaContainer withLeafCount(Optional<Integer> leafCount) {
        Utils.checkNotNull(leafCount, "leafCount");
        this.leafCount = leafCount;
        return this;
    }

    public GetPlaylistContentsMediaContainer withPlaylistType(String playlistType) {
        Utils.checkNotNull(playlistType, "playlistType");
        this.playlistType = Optional.ofNullable(playlistType);
        return this;
    }

    public GetPlaylistContentsMediaContainer withPlaylistType(Optional<String> playlistType) {
        Utils.checkNotNull(playlistType, "playlistType");
        this.playlistType = playlistType;
        return this;
    }

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

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

    public GetPlaylistContentsMediaContainer withSmart(boolean smart) {
        Utils.checkNotNull(smart, "smart");
        this.smart = Optional.ofNullable(smart);
        return this;
    }

    public GetPlaylistContentsMediaContainer withSmart(Optional<Boolean> smart) {
        Utils.checkNotNull(smart, "smart");
        this.smart = smart;
        return this;
    }

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

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

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

    public GetPlaylistContentsMediaContainer withMetadata(Optional<? extends List<GetPlaylistContentsMetadata>> 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;
        }
        GetPlaylistContentsMediaContainer other = (GetPlaylistContentsMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.composite, other.composite) &&
            Objects.deepEquals(this.duration, other.duration) &&
            Objects.deepEquals(this.leafCount, other.leafCount) &&
            Objects.deepEquals(this.playlistType, other.playlistType) &&
            Objects.deepEquals(this.ratingKey, other.ratingKey) &&
            Objects.deepEquals(this.smart, other.smart) &&
            Objects.deepEquals(this.title, other.title) &&
            Objects.deepEquals(this.metadata, other.metadata);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            composite,
            duration,
            leafCount,
            playlistType,
            ratingKey,
            smart,
            title,
            metadata);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetPlaylistContentsMediaContainer.class,
                "size", size,
                "composite", composite,
                "duration", duration,
                "leafCount", leafCount,
                "playlistType", playlistType,
                "ratingKey", ratingKey,
                "smart", smart,
                "title", title,
                "metadata", metadata);
    }
    
    public final static class Builder {
 
        private Optional<Integer> size = Optional.empty();
 
        private Optional<String> composite = Optional.empty();
 
        private Optional<Integer> duration = Optional.empty();
 
        private Optional<Integer> leafCount = Optional.empty();
 
        private Optional<String> playlistType = Optional.empty();
 
        private Optional<String> ratingKey = Optional.empty();
 
        private Optional<Boolean> smart = Optional.empty();
 
        private Optional<String> title = Optional.empty();
 
        private Optional<? extends List<GetPlaylistContentsMetadata>> 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 composite(String composite) {
            Utils.checkNotNull(composite, "composite");
            this.composite = Optional.ofNullable(composite);
            return this;
        }

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

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

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

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

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

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

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

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

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

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

        public Builder smart(Optional<Boolean> smart) {
            Utils.checkNotNull(smart, "smart");
            this.smart = smart;
            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 metadata(List<GetPlaylistContentsMetadata> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = Optional.ofNullable(metadata);
            return this;
        }

        public Builder metadata(Optional<? extends List<GetPlaylistContentsMetadata>> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = metadata;
            return this;
        }
        
        public GetPlaylistContentsMediaContainer build() {
            return new GetPlaylistContentsMediaContainer(
                size,
                composite,
                duration,
                leafCount,
                playlistType,
                ratingKey,
                smart,
                title,
                metadata);
        }
    }
}

