/* * 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.Double; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.Objects; import java.util.Optional; public class Activity { @JsonInclude(Include.NON_ABSENT) @JsonProperty("uuid") private Optional uuid; @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("cancellable") private Optional cancellable; @JsonInclude(Include.NON_ABSENT) @JsonProperty("userID") private Optional userID; @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtitle") private Optional subtitle; @JsonInclude(Include.NON_ABSENT) @JsonProperty("progress") private Optional progress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("Context") private Optional context; @JsonCreator public Activity( @JsonProperty("uuid") Optional uuid, @JsonProperty("type") Optional type, @JsonProperty("cancellable") Optional cancellable, @JsonProperty("userID") Optional userID, @JsonProperty("title") Optional title, @JsonProperty("subtitle") Optional subtitle, @JsonProperty("progress") Optional progress, @JsonProperty("Context") Optional context) { Utils.checkNotNull(uuid, "uuid"); Utils.checkNotNull(type, "type"); Utils.checkNotNull(cancellable, "cancellable"); Utils.checkNotNull(userID, "userID"); Utils.checkNotNull(title, "title"); Utils.checkNotNull(subtitle, "subtitle"); Utils.checkNotNull(progress, "progress"); Utils.checkNotNull(context, "context"); this.uuid = uuid; this.type = type; this.cancellable = cancellable; this.userID = userID; this.title = title; this.subtitle = subtitle; this.progress = progress; this.context = context; } public Activity() { this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore public Optional uuid() { return uuid; } @JsonIgnore public Optional type() { return type; } @JsonIgnore public Optional cancellable() { return cancellable; } @JsonIgnore public Optional userID() { return userID; } @JsonIgnore public Optional title() { return title; } @JsonIgnore public Optional subtitle() { return subtitle; } @JsonIgnore public Optional progress() { return progress; } @SuppressWarnings("unchecked") @JsonIgnore public Optional context() { return (Optional) context; } public final static Builder builder() { return new Builder(); } public Activity withUuid(String uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = Optional.ofNullable(uuid); return this; } public Activity withUuid(Optional uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = uuid; return this; } public Activity withType(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); return this; } public Activity withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public Activity withCancellable(boolean cancellable) { Utils.checkNotNull(cancellable, "cancellable"); this.cancellable = Optional.ofNullable(cancellable); return this; } public Activity withCancellable(Optional cancellable) { Utils.checkNotNull(cancellable, "cancellable"); this.cancellable = cancellable; return this; } public Activity withUserID(double userID) { Utils.checkNotNull(userID, "userID"); this.userID = Optional.ofNullable(userID); return this; } public Activity withUserID(Optional userID) { Utils.checkNotNull(userID, "userID"); this.userID = userID; return this; } public Activity withTitle(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); return this; } public Activity withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } public Activity withSubtitle(String subtitle) { Utils.checkNotNull(subtitle, "subtitle"); this.subtitle = Optional.ofNullable(subtitle); return this; } public Activity withSubtitle(Optional subtitle) { Utils.checkNotNull(subtitle, "subtitle"); this.subtitle = subtitle; return this; } public Activity withProgress(double progress) { Utils.checkNotNull(progress, "progress"); this.progress = Optional.ofNullable(progress); return this; } public Activity withProgress(Optional progress) { Utils.checkNotNull(progress, "progress"); this.progress = progress; return this; } public Activity withContext(Context context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); return this; } public Activity withContext(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Activity other = (Activity) o; return Objects.deepEquals(this.uuid, other.uuid) && Objects.deepEquals(this.type, other.type) && Objects.deepEquals(this.cancellable, other.cancellable) && Objects.deepEquals(this.userID, other.userID) && Objects.deepEquals(this.title, other.title) && Objects.deepEquals(this.subtitle, other.subtitle) && Objects.deepEquals(this.progress, other.progress) && Objects.deepEquals(this.context, other.context); } @Override public int hashCode() { return Objects.hash( uuid, type, cancellable, userID, title, subtitle, progress, context); } @Override public String toString() { return Utils.toString(Activity.class, "uuid", uuid, "type", type, "cancellable", cancellable, "userID", userID, "title", title, "subtitle", subtitle, "progress", progress, "context", context); } public final static class Builder { private Optional uuid = Optional.empty(); private Optional type = Optional.empty(); private Optional cancellable = Optional.empty(); private Optional userID = Optional.empty(); private Optional title = Optional.empty(); private Optional subtitle = Optional.empty(); private Optional progress = Optional.empty(); private Optional context = Optional.empty(); private Builder() { // force use of static builder() method } public Builder uuid(String uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = Optional.ofNullable(uuid); return this; } public Builder uuid(Optional uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = uuid; return this; } public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); return this; } public Builder type(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public Builder cancellable(boolean cancellable) { Utils.checkNotNull(cancellable, "cancellable"); this.cancellable = Optional.ofNullable(cancellable); return this; } public Builder cancellable(Optional cancellable) { Utils.checkNotNull(cancellable, "cancellable"); this.cancellable = cancellable; return this; } public Builder userID(double userID) { Utils.checkNotNull(userID, "userID"); this.userID = Optional.ofNullable(userID); return this; } public Builder userID(Optional userID) { Utils.checkNotNull(userID, "userID"); this.userID = userID; return this; } public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); return this; } public Builder title(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } public Builder subtitle(String subtitle) { Utils.checkNotNull(subtitle, "subtitle"); this.subtitle = Optional.ofNullable(subtitle); return this; } public Builder subtitle(Optional subtitle) { Utils.checkNotNull(subtitle, "subtitle"); this.subtitle = subtitle; return this; } public Builder progress(double progress) { Utils.checkNotNull(progress, "progress"); this.progress = Optional.ofNullable(progress); return this; } public Builder progress(Optional progress) { Utils.checkNotNull(progress, "progress"); this.progress = progress; return this; } public Builder context(Context context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); return this; } public Builder context(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; return this; } public Activity build() { return new Activity( uuid, type, cancellable, userID, title, subtitle, progress, context); } } }