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


public class Setting {

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

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

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

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

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

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

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

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

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

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

    @JsonCreator
    public Setting(
            @JsonProperty("id") Optional<String> id,
            @JsonProperty("label") Optional<String> label,
            @JsonProperty("summary") Optional<String> summary,
            @JsonProperty("type") Optional<String> type,
            @JsonProperty("default") Optional<Boolean> default_,
            @JsonProperty("value") Optional<Boolean> value,
            @JsonProperty("hidden") Optional<Boolean> hidden,
            @JsonProperty("advanced") Optional<Boolean> advanced,
            @JsonProperty("group") Optional<String> group,
            @JsonProperty("enumValues") Optional<String> enumValues) {
        Utils.checkNotNull(id, "id");
        Utils.checkNotNull(label, "label");
        Utils.checkNotNull(summary, "summary");
        Utils.checkNotNull(type, "type");
        Utils.checkNotNull(default_, "default_");
        Utils.checkNotNull(value, "value");
        Utils.checkNotNull(hidden, "hidden");
        Utils.checkNotNull(advanced, "advanced");
        Utils.checkNotNull(group, "group");
        Utils.checkNotNull(enumValues, "enumValues");
        this.id = id;
        this.label = label;
        this.summary = summary;
        this.type = type;
        this.default_ = default_;
        this.value = value;
        this.hidden = hidden;
        this.advanced = advanced;
        this.group = group;
        this.enumValues = enumValues;
    }
    
    public Setting() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

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

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

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

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

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

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

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

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

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

    public Setting withId(String id) {
        Utils.checkNotNull(id, "id");
        this.id = Optional.ofNullable(id);
        return this;
    }

    public Setting withId(Optional<String> id) {
        Utils.checkNotNull(id, "id");
        this.id = id;
        return this;
    }

    public Setting withLabel(String label) {
        Utils.checkNotNull(label, "label");
        this.label = Optional.ofNullable(label);
        return this;
    }

    public Setting withLabel(Optional<String> label) {
        Utils.checkNotNull(label, "label");
        this.label = label;
        return this;
    }

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

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

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

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

    public Setting withDefault(boolean default_) {
        Utils.checkNotNull(default_, "default_");
        this.default_ = Optional.ofNullable(default_);
        return this;
    }

    public Setting withDefault(Optional<Boolean> default_) {
        Utils.checkNotNull(default_, "default_");
        this.default_ = default_;
        return this;
    }

    public Setting withValue(boolean value) {
        Utils.checkNotNull(value, "value");
        this.value = Optional.ofNullable(value);
        return this;
    }

    public Setting withValue(Optional<Boolean> value) {
        Utils.checkNotNull(value, "value");
        this.value = value;
        return this;
    }

    public Setting withHidden(boolean hidden) {
        Utils.checkNotNull(hidden, "hidden");
        this.hidden = Optional.ofNullable(hidden);
        return this;
    }

    public Setting withHidden(Optional<Boolean> hidden) {
        Utils.checkNotNull(hidden, "hidden");
        this.hidden = hidden;
        return this;
    }

    public Setting withAdvanced(boolean advanced) {
        Utils.checkNotNull(advanced, "advanced");
        this.advanced = Optional.ofNullable(advanced);
        return this;
    }

    public Setting withAdvanced(Optional<Boolean> advanced) {
        Utils.checkNotNull(advanced, "advanced");
        this.advanced = advanced;
        return this;
    }

    public Setting withGroup(String group) {
        Utils.checkNotNull(group, "group");
        this.group = Optional.ofNullable(group);
        return this;
    }

    public Setting withGroup(Optional<String> group) {
        Utils.checkNotNull(group, "group");
        this.group = group;
        return this;
    }

    public Setting withEnumValues(String enumValues) {
        Utils.checkNotNull(enumValues, "enumValues");
        this.enumValues = Optional.ofNullable(enumValues);
        return this;
    }

    public Setting withEnumValues(Optional<String> enumValues) {
        Utils.checkNotNull(enumValues, "enumValues");
        this.enumValues = enumValues;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Setting other = (Setting) o;
        return 
            Objects.deepEquals(this.id, other.id) &&
            Objects.deepEquals(this.label, other.label) &&
            Objects.deepEquals(this.summary, other.summary) &&
            Objects.deepEquals(this.type, other.type) &&
            Objects.deepEquals(this.default_, other.default_) &&
            Objects.deepEquals(this.value, other.value) &&
            Objects.deepEquals(this.hidden, other.hidden) &&
            Objects.deepEquals(this.advanced, other.advanced) &&
            Objects.deepEquals(this.group, other.group) &&
            Objects.deepEquals(this.enumValues, other.enumValues);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            id,
            label,
            summary,
            type,
            default_,
            value,
            hidden,
            advanced,
            group,
            enumValues);
    }
    
    @Override
    public String toString() {
        return Utils.toString(Setting.class,
                "id", id,
                "label", label,
                "summary", summary,
                "type", type,
                "default_", default_,
                "value", value,
                "hidden", hidden,
                "advanced", advanced,
                "group", group,
                "enumValues", enumValues);
    }
    
    public final static class Builder {
 
        private Optional<String> id = Optional.empty();
 
        private Optional<String> label = Optional.empty();
 
        private Optional<String> summary = Optional.empty();
 
        private Optional<String> type = Optional.empty();
 
        private Optional<Boolean> default_ = Optional.empty();
 
        private Optional<Boolean> value = Optional.empty();
 
        private Optional<Boolean> hidden = Optional.empty();
 
        private Optional<Boolean> advanced = Optional.empty();
 
        private Optional<String> group = Optional.empty();
 
        private Optional<String> enumValues = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public Builder enumValues(Optional<String> enumValues) {
            Utils.checkNotNull(enumValues, "enumValues");
            this.enumValues = enumValues;
            return this;
        }
        
        public Setting build() {
            return new Setting(
                id,
                label,
                summary,
                type,
                default_,
                value,
                hidden,
                advanced,
                group,
                enumValues);
        }
    }
}

