/* * 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.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; import java.util.Objects; import java.util.Optional; public class Feature { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; @JsonProperty("type") private String type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("flavor") private Optional flavor; @JsonInclude(Include.NON_ABSENT) @JsonProperty("scrobbleKey") private Optional scrobbleKey; @JsonInclude(Include.NON_ABSENT) @JsonProperty("unscrobbleKey") private Optional unscrobbleKey; @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") private Optional> directory; @JsonInclude(Include.NON_ABSENT) @JsonProperty("Action") private Optional> action; @JsonCreator public Feature( @JsonProperty("key") Optional key, @JsonProperty("type") String type, @JsonProperty("flavor") Optional flavor, @JsonProperty("scrobbleKey") Optional scrobbleKey, @JsonProperty("unscrobbleKey") Optional unscrobbleKey, @JsonProperty("Directory") Optional> directory, @JsonProperty("Action") Optional> action) { Utils.checkNotNull(key, "key"); Utils.checkNotNull(type, "type"); Utils.checkNotNull(flavor, "flavor"); Utils.checkNotNull(scrobbleKey, "scrobbleKey"); Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); Utils.checkNotNull(directory, "directory"); Utils.checkNotNull(action, "action"); this.key = key; this.type = type; this.flavor = flavor; this.scrobbleKey = scrobbleKey; this.unscrobbleKey = unscrobbleKey; this.directory = directory; this.action = action; } public Feature( String type) { this(Optional.empty(), type, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore public Optional key() { return key; } @JsonIgnore public String type() { return type; } @JsonIgnore public Optional flavor() { return flavor; } @JsonIgnore public Optional scrobbleKey() { return scrobbleKey; } @JsonIgnore public Optional unscrobbleKey() { return unscrobbleKey; } @SuppressWarnings("unchecked") @JsonIgnore public Optional> directory() { return (Optional>) directory; } @SuppressWarnings("unchecked") @JsonIgnore public Optional> action() { return (Optional>) action; } public final static Builder builder() { return new Builder(); } public Feature withKey(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); return this; } public Feature withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } public Feature withType(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public Feature withFlavor(String flavor) { Utils.checkNotNull(flavor, "flavor"); this.flavor = Optional.ofNullable(flavor); return this; } public Feature withFlavor(Optional flavor) { Utils.checkNotNull(flavor, "flavor"); this.flavor = flavor; return this; } public Feature withScrobbleKey(String scrobbleKey) { Utils.checkNotNull(scrobbleKey, "scrobbleKey"); this.scrobbleKey = Optional.ofNullable(scrobbleKey); return this; } public Feature withScrobbleKey(Optional scrobbleKey) { Utils.checkNotNull(scrobbleKey, "scrobbleKey"); this.scrobbleKey = scrobbleKey; return this; } public Feature withUnscrobbleKey(String unscrobbleKey) { Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); this.unscrobbleKey = Optional.ofNullable(unscrobbleKey); return this; } public Feature withUnscrobbleKey(Optional unscrobbleKey) { Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); this.unscrobbleKey = unscrobbleKey; return this; } public Feature withDirectory(List directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); return this; } public Feature withDirectory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; } public Feature withAction(List action) { Utils.checkNotNull(action, "action"); this.action = Optional.ofNullable(action); return this; } public Feature withAction(Optional> action) { Utils.checkNotNull(action, "action"); this.action = action; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Feature other = (Feature) o; return Objects.deepEquals(this.key, other.key) && Objects.deepEquals(this.type, other.type) && Objects.deepEquals(this.flavor, other.flavor) && Objects.deepEquals(this.scrobbleKey, other.scrobbleKey) && Objects.deepEquals(this.unscrobbleKey, other.unscrobbleKey) && Objects.deepEquals(this.directory, other.directory) && Objects.deepEquals(this.action, other.action); } @Override public int hashCode() { return Objects.hash( key, type, flavor, scrobbleKey, unscrobbleKey, directory, action); } @Override public String toString() { return Utils.toString(Feature.class, "key", key, "type", type, "flavor", flavor, "scrobbleKey", scrobbleKey, "unscrobbleKey", unscrobbleKey, "directory", directory, "action", action); } public final static class Builder { private Optional key = Optional.empty(); private String type; private Optional flavor = Optional.empty(); private Optional scrobbleKey = Optional.empty(); private Optional unscrobbleKey = Optional.empty(); private Optional> directory = Optional.empty(); private Optional> action = Optional.empty(); private Builder() { // force use of static builder() method } public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); return this; } public Builder key(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public Builder flavor(String flavor) { Utils.checkNotNull(flavor, "flavor"); this.flavor = Optional.ofNullable(flavor); return this; } public Builder flavor(Optional flavor) { Utils.checkNotNull(flavor, "flavor"); this.flavor = flavor; return this; } public Builder scrobbleKey(String scrobbleKey) { Utils.checkNotNull(scrobbleKey, "scrobbleKey"); this.scrobbleKey = Optional.ofNullable(scrobbleKey); return this; } public Builder scrobbleKey(Optional scrobbleKey) { Utils.checkNotNull(scrobbleKey, "scrobbleKey"); this.scrobbleKey = scrobbleKey; return this; } public Builder unscrobbleKey(String unscrobbleKey) { Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); this.unscrobbleKey = Optional.ofNullable(unscrobbleKey); return this; } public Builder unscrobbleKey(Optional unscrobbleKey) { Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); this.unscrobbleKey = unscrobbleKey; return this; } public Builder directory(List directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); return this; } public Builder directory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; } public Builder action(List action) { Utils.checkNotNull(action, "action"); this.action = Optional.ofNullable(action); return this; } public Builder action(Optional> action) { Utils.checkNotNull(action, "action"); this.action = action; return this; } public Feature build() { return new Feature( key, type, flavor, scrobbleKey, unscrobbleKey, directory, action); } } }