/* 
 * 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.util.Objects;
import java.util.Optional;


public class GetGlobalHubsMetadata {

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

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

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

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

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

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

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

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

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

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

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

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

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

    @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("addedAt")
    private Optional<Integer> addedAt;

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

    @JsonCreator
    public GetGlobalHubsMetadata(
            @JsonProperty("ratingKey") Optional<String> ratingKey,
            @JsonProperty("key") Optional<String> key,
            @JsonProperty("guid") Optional<String> guid,
            @JsonProperty("type") Optional<String> type,
            @JsonProperty("title") Optional<String> title,
            @JsonProperty("titleSort") Optional<String> titleSort,
            @JsonProperty("summary") Optional<String> summary,
            @JsonProperty("smart") Optional<Boolean> smart,
            @JsonProperty("playlistType") Optional<String> playlistType,
            @JsonProperty("composite") Optional<String> composite,
            @JsonProperty("icon") Optional<String> icon,
            @JsonProperty("viewCount") Optional<Integer> viewCount,
            @JsonProperty("lastViewedAt") Optional<Integer> lastViewedAt,
            @JsonProperty("duration") Optional<Integer> duration,
            @JsonProperty("leafCount") Optional<Integer> leafCount,
            @JsonProperty("addedAt") Optional<Integer> addedAt,
            @JsonProperty("updatedAt") Optional<Integer> updatedAt) {
        Utils.checkNotNull(ratingKey, "ratingKey");
        Utils.checkNotNull(key, "key");
        Utils.checkNotNull(guid, "guid");
        Utils.checkNotNull(type, "type");
        Utils.checkNotNull(title, "title");
        Utils.checkNotNull(titleSort, "titleSort");
        Utils.checkNotNull(summary, "summary");
        Utils.checkNotNull(smart, "smart");
        Utils.checkNotNull(playlistType, "playlistType");
        Utils.checkNotNull(composite, "composite");
        Utils.checkNotNull(icon, "icon");
        Utils.checkNotNull(viewCount, "viewCount");
        Utils.checkNotNull(lastViewedAt, "lastViewedAt");
        Utils.checkNotNull(duration, "duration");
        Utils.checkNotNull(leafCount, "leafCount");
        Utils.checkNotNull(addedAt, "addedAt");
        Utils.checkNotNull(updatedAt, "updatedAt");
        this.ratingKey = ratingKey;
        this.key = key;
        this.guid = guid;
        this.type = type;
        this.title = title;
        this.titleSort = titleSort;
        this.summary = summary;
        this.smart = smart;
        this.playlistType = playlistType;
        this.composite = composite;
        this.icon = icon;
        this.viewCount = viewCount;
        this.lastViewedAt = lastViewedAt;
        this.duration = duration;
        this.leafCount = leafCount;
        this.addedAt = addedAt;
        this.updatedAt = updatedAt;
    }
    
    public GetGlobalHubsMetadata() {
        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());
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public GetGlobalHubsMetadata withTitleSort(String titleSort) {
        Utils.checkNotNull(titleSort, "titleSort");
        this.titleSort = Optional.ofNullable(titleSort);
        return this;
    }

    public GetGlobalHubsMetadata withTitleSort(Optional<String> titleSort) {
        Utils.checkNotNull(titleSort, "titleSort");
        this.titleSort = titleSort;
        return this;
    }

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

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

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

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

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

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

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

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

    public GetGlobalHubsMetadata withIcon(String icon) {
        Utils.checkNotNull(icon, "icon");
        this.icon = Optional.ofNullable(icon);
        return this;
    }

    public GetGlobalHubsMetadata withIcon(Optional<String> icon) {
        Utils.checkNotNull(icon, "icon");
        this.icon = icon;
        return this;
    }

    public GetGlobalHubsMetadata withViewCount(int viewCount) {
        Utils.checkNotNull(viewCount, "viewCount");
        this.viewCount = Optional.ofNullable(viewCount);
        return this;
    }

    public GetGlobalHubsMetadata withViewCount(Optional<Integer> viewCount) {
        Utils.checkNotNull(viewCount, "viewCount");
        this.viewCount = viewCount;
        return this;
    }

    public GetGlobalHubsMetadata withLastViewedAt(int lastViewedAt) {
        Utils.checkNotNull(lastViewedAt, "lastViewedAt");
        this.lastViewedAt = Optional.ofNullable(lastViewedAt);
        return this;
    }

    public GetGlobalHubsMetadata withLastViewedAt(Optional<Integer> lastViewedAt) {
        Utils.checkNotNull(lastViewedAt, "lastViewedAt");
        this.lastViewedAt = lastViewedAt;
        return this;
    }

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

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

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

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

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

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

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

    public GetGlobalHubsMetadata withUpdatedAt(Optional<Integer> updatedAt) {
        Utils.checkNotNull(updatedAt, "updatedAt");
        this.updatedAt = updatedAt;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetGlobalHubsMetadata other = (GetGlobalHubsMetadata) o;
        return 
            Objects.deepEquals(this.ratingKey, other.ratingKey) &&
            Objects.deepEquals(this.key, other.key) &&
            Objects.deepEquals(this.guid, other.guid) &&
            Objects.deepEquals(this.type, other.type) &&
            Objects.deepEquals(this.title, other.title) &&
            Objects.deepEquals(this.titleSort, other.titleSort) &&
            Objects.deepEquals(this.summary, other.summary) &&
            Objects.deepEquals(this.smart, other.smart) &&
            Objects.deepEquals(this.playlistType, other.playlistType) &&
            Objects.deepEquals(this.composite, other.composite) &&
            Objects.deepEquals(this.icon, other.icon) &&
            Objects.deepEquals(this.viewCount, other.viewCount) &&
            Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) &&
            Objects.deepEquals(this.duration, other.duration) &&
            Objects.deepEquals(this.leafCount, other.leafCount) &&
            Objects.deepEquals(this.addedAt, other.addedAt) &&
            Objects.deepEquals(this.updatedAt, other.updatedAt);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            ratingKey,
            key,
            guid,
            type,
            title,
            titleSort,
            summary,
            smart,
            playlistType,
            composite,
            icon,
            viewCount,
            lastViewedAt,
            duration,
            leafCount,
            addedAt,
            updatedAt);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetGlobalHubsMetadata.class,
                "ratingKey", ratingKey,
                "key", key,
                "guid", guid,
                "type", type,
                "title", title,
                "titleSort", titleSort,
                "summary", summary,
                "smart", smart,
                "playlistType", playlistType,
                "composite", composite,
                "icon", icon,
                "viewCount", viewCount,
                "lastViewedAt", lastViewedAt,
                "duration", duration,
                "leafCount", leafCount,
                "addedAt", addedAt,
                "updatedAt", updatedAt);
    }
    
    public final static class Builder {
 
        private Optional<String> ratingKey = Optional.empty();
 
        private Optional<String> key = Optional.empty();
 
        private Optional<String> guid = Optional.empty();
 
        private Optional<String> type = Optional.empty();
 
        private Optional<String> title = Optional.empty();
 
        private Optional<String> titleSort = Optional.empty();
 
        private Optional<String> summary = Optional.empty();
 
        private Optional<Boolean> smart = Optional.empty();
 
        private Optional<String> playlistType = Optional.empty();
 
        private Optional<String> composite = Optional.empty();
 
        private Optional<String> icon = Optional.empty();
 
        private Optional<Integer> viewCount = Optional.empty();
 
        private Optional<Integer> lastViewedAt = Optional.empty();
 
        private Optional<Integer> duration = Optional.empty();
 
        private Optional<Integer> leafCount = Optional.empty();
 
        private Optional<Integer> addedAt = Optional.empty();
 
        private Optional<Integer> updatedAt = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public Builder updatedAt(Optional<Integer> updatedAt) {
            Utils.checkNotNull(updatedAt, "updatedAt");
            this.updatedAt = updatedAt;
            return this;
        }
        
        public GetGlobalHubsMetadata build() {
            return new GetGlobalHubsMetadata(
                ratingKey,
                key,
                guid,
                type,
                title,
                titleSort,
                summary,
                smart,
                playlistType,
                composite,
                icon,
                viewCount,
                lastViewedAt,
                duration,
                leafCount,
                addedAt,
                updatedAt);
        }
    }
}

