/* * 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.Long; import java.lang.Override; import java.lang.String; import java.util.Objects; import java.util.Optional; public class Role { /** * The ID of the tag or actor. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; /** * The filter used to find the actor or tag. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("filter") private Optional filter; /** * The thumbnail of the actor */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; /** * The name of the tag or actor. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; /** * Unique identifier for the tag. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagKey") private Optional tagKey; /** * The role of the actor or tag in the media. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("role") private Optional role; @JsonCreator public Role( @JsonProperty("id") Optional id, @JsonProperty("filter") Optional filter, @JsonProperty("thumb") Optional thumb, @JsonProperty("tag") Optional tag, @JsonProperty("tagKey") Optional tagKey, @JsonProperty("role") Optional role) { Utils.checkNotNull(id, "id"); Utils.checkNotNull(filter, "filter"); Utils.checkNotNull(thumb, "thumb"); Utils.checkNotNull(tag, "tag"); Utils.checkNotNull(tagKey, "tagKey"); Utils.checkNotNull(role, "role"); this.id = id; this.filter = filter; this.thumb = thumb; this.tag = tag; this.tagKey = tagKey; this.role = role; } public Role() { this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** * The ID of the tag or actor. */ @JsonIgnore public Optional id() { return id; } /** * The filter used to find the actor or tag. */ @JsonIgnore public Optional filter() { return filter; } /** * The thumbnail of the actor */ @JsonIgnore public Optional thumb() { return thumb; } /** * The name of the tag or actor. */ @JsonIgnore public Optional tag() { return tag; } /** * Unique identifier for the tag. */ @JsonIgnore public Optional tagKey() { return tagKey; } /** * The role of the actor or tag in the media. */ @JsonIgnore public Optional role() { return role; } public final static Builder builder() { return new Builder(); } /** * The ID of the tag or actor. */ public Role withId(long id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); return this; } /** * The ID of the tag or actor. */ public Role withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } /** * The filter used to find the actor or tag. */ public Role withFilter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); return this; } /** * The filter used to find the actor or tag. */ public Role withFilter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } /** * The thumbnail of the actor */ public Role withThumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); return this; } /** * The thumbnail of the actor */ public Role withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } /** * The name of the tag or actor. */ public Role withTag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); return this; } /** * The name of the tag or actor. */ public Role withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } /** * Unique identifier for the tag. */ public Role withTagKey(String tagKey) { Utils.checkNotNull(tagKey, "tagKey"); this.tagKey = Optional.ofNullable(tagKey); return this; } /** * Unique identifier for the tag. */ public Role withTagKey(Optional tagKey) { Utils.checkNotNull(tagKey, "tagKey"); this.tagKey = tagKey; return this; } /** * The role of the actor or tag in the media. */ public Role withRole(String role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); return this; } /** * The role of the actor or tag in the media. */ public Role withRole(Optional role) { Utils.checkNotNull(role, "role"); this.role = role; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Role other = (Role) o; return Objects.deepEquals(this.id, other.id) && Objects.deepEquals(this.filter, other.filter) && Objects.deepEquals(this.thumb, other.thumb) && Objects.deepEquals(this.tag, other.tag) && Objects.deepEquals(this.tagKey, other.tagKey) && Objects.deepEquals(this.role, other.role); } @Override public int hashCode() { return Objects.hash( id, filter, thumb, tag, tagKey, role); } @Override public String toString() { return Utils.toString(Role.class, "id", id, "filter", filter, "thumb", thumb, "tag", tag, "tagKey", tagKey, "role", role); } public final static class Builder { private Optional id = Optional.empty(); private Optional filter = Optional.empty(); private Optional thumb = Optional.empty(); private Optional tag = Optional.empty(); private Optional tagKey = Optional.empty(); private Optional role = Optional.empty(); private Builder() { // force use of static builder() method } /** * The ID of the tag or actor. */ public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); return this; } /** * The ID of the tag or actor. */ public Builder id(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } /** * The filter used to find the actor or tag. */ public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); return this; } /** * The filter used to find the actor or tag. */ public Builder filter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } /** * The thumbnail of the actor */ public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); return this; } /** * The thumbnail of the actor */ public Builder thumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } /** * The name of the tag or actor. */ public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); return this; } /** * The name of the tag or actor. */ public Builder tag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } /** * Unique identifier for the tag. */ public Builder tagKey(String tagKey) { Utils.checkNotNull(tagKey, "tagKey"); this.tagKey = Optional.ofNullable(tagKey); return this; } /** * Unique identifier for the tag. */ public Builder tagKey(Optional tagKey) { Utils.checkNotNull(tagKey, "tagKey"); this.tagKey = tagKey; return this; } /** * The role of the actor or tag in the media. */ public Builder role(String role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); return this; } /** * The role of the actor or tag in the media. */ public Builder role(Optional role) { Utils.checkNotNull(role, "role"); this.role = role; return this; } public Role build() { return new Role( id, filter, thumb, tag, tagKey, role); } } }