/* * 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.Double; import java.lang.Override; import java.lang.String; import java.util.Objects; import java.util.Optional; public class Device { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; @JsonInclude(Include.NON_ABSENT) @JsonProperty("platform") private Optional platform; @JsonInclude(Include.NON_ABSENT) @JsonProperty("clientIdentifier") private Optional clientIdentifier; @JsonInclude(Include.NON_ABSENT) @JsonProperty("createdAt") private Optional createdAt; @JsonCreator public Device( @JsonProperty("id") Optional id, @JsonProperty("name") Optional name, @JsonProperty("platform") Optional platform, @JsonProperty("clientIdentifier") Optional clientIdentifier, @JsonProperty("createdAt") Optional createdAt) { Utils.checkNotNull(id, "id"); Utils.checkNotNull(name, "name"); Utils.checkNotNull(platform, "platform"); Utils.checkNotNull(clientIdentifier, "clientIdentifier"); Utils.checkNotNull(createdAt, "createdAt"); this.id = id; this.name = name; this.platform = platform; this.clientIdentifier = clientIdentifier; this.createdAt = createdAt; } public Device() { this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore public Optional id() { return id; } @JsonIgnore public Optional name() { return name; } @JsonIgnore public Optional platform() { return platform; } @JsonIgnore public Optional clientIdentifier() { return clientIdentifier; } @JsonIgnore public Optional createdAt() { return createdAt; } public final static Builder builder() { return new Builder(); } public Device withId(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); return this; } public Device withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } public Device withName(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); return this; } public Device withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; return this; } public Device withPlatform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); return this; } public Device withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; return this; } public Device withClientIdentifier(String clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = Optional.ofNullable(clientIdentifier); return this; } public Device withClientIdentifier(Optional clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = clientIdentifier; return this; } public Device withCreatedAt(double createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = Optional.ofNullable(createdAt); return this; } public Device withCreatedAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Device other = (Device) o; return Objects.deepEquals(this.id, other.id) && Objects.deepEquals(this.name, other.name) && Objects.deepEquals(this.platform, other.platform) && Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && Objects.deepEquals(this.createdAt, other.createdAt); } @Override public int hashCode() { return Objects.hash( id, name, platform, clientIdentifier, createdAt); } @Override public String toString() { return Utils.toString(Device.class, "id", id, "name", name, "platform", platform, "clientIdentifier", clientIdentifier, "createdAt", createdAt); } public final static class Builder { private Optional id = Optional.empty(); private Optional name = Optional.empty(); private Optional platform = Optional.empty(); private Optional clientIdentifier = Optional.empty(); private Optional createdAt = Optional.empty(); private Builder() { // force use of static builder() method } public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); return this; } public Builder id(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); return this; } public Builder name(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; return this; } public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); return this; } public Builder platform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; return this; } public Builder clientIdentifier(String clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = Optional.ofNullable(clientIdentifier); return this; } public Builder clientIdentifier(Optional clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = clientIdentifier; return this; } public Builder createdAt(double createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = Optional.ofNullable(createdAt); return this; } public Builder createdAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } public Device build() { return new Device( id, name, platform, clientIdentifier, createdAt); } } }