/* * 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.Integer; import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.Objects; import java.util.Optional; public class StatisticsBandwidth { @JsonInclude(Include.NON_ABSENT) @JsonProperty("accountID") private Optional accountID; @JsonInclude(Include.NON_ABSENT) @JsonProperty("deviceID") private Optional deviceID; @JsonInclude(Include.NON_ABSENT) @JsonProperty("timespan") private Optional timespan; @JsonInclude(Include.NON_ABSENT) @JsonProperty("at") private Optional at; @JsonInclude(Include.NON_ABSENT) @JsonProperty("lan") private Optional lan; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bytes") private Optional bytes; @JsonCreator public StatisticsBandwidth( @JsonProperty("accountID") Optional accountID, @JsonProperty("deviceID") Optional deviceID, @JsonProperty("timespan") Optional timespan, @JsonProperty("at") Optional at, @JsonProperty("lan") Optional lan, @JsonProperty("bytes") Optional bytes) { Utils.checkNotNull(accountID, "accountID"); Utils.checkNotNull(deviceID, "deviceID"); Utils.checkNotNull(timespan, "timespan"); Utils.checkNotNull(at, "at"); Utils.checkNotNull(lan, "lan"); Utils.checkNotNull(bytes, "bytes"); this.accountID = accountID; this.deviceID = deviceID; this.timespan = timespan; this.at = at; this.lan = lan; this.bytes = bytes; } public StatisticsBandwidth() { this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore public Optional accountID() { return accountID; } @JsonIgnore public Optional deviceID() { return deviceID; } @JsonIgnore public Optional timespan() { return timespan; } @JsonIgnore public Optional at() { return at; } @JsonIgnore public Optional lan() { return lan; } @JsonIgnore public Optional bytes() { return bytes; } public final static Builder builder() { return new Builder(); } public StatisticsBandwidth withAccountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = Optional.ofNullable(accountID); return this; } public StatisticsBandwidth withAccountID(Optional accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = accountID; return this; } public StatisticsBandwidth withDeviceID(int deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = Optional.ofNullable(deviceID); return this; } public StatisticsBandwidth withDeviceID(Optional deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = deviceID; return this; } public StatisticsBandwidth withTimespan(long timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = Optional.ofNullable(timespan); return this; } public StatisticsBandwidth withTimespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; return this; } public StatisticsBandwidth withAt(int at) { Utils.checkNotNull(at, "at"); this.at = Optional.ofNullable(at); return this; } public StatisticsBandwidth withAt(Optional at) { Utils.checkNotNull(at, "at"); this.at = at; return this; } public StatisticsBandwidth withLan(boolean lan) { Utils.checkNotNull(lan, "lan"); this.lan = Optional.ofNullable(lan); return this; } public StatisticsBandwidth withLan(Optional lan) { Utils.checkNotNull(lan, "lan"); this.lan = lan; return this; } public StatisticsBandwidth withBytes(long bytes) { Utils.checkNotNull(bytes, "bytes"); this.bytes = Optional.ofNullable(bytes); return this; } public StatisticsBandwidth withBytes(Optional bytes) { Utils.checkNotNull(bytes, "bytes"); this.bytes = bytes; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StatisticsBandwidth other = (StatisticsBandwidth) o; return Objects.deepEquals(this.accountID, other.accountID) && Objects.deepEquals(this.deviceID, other.deviceID) && Objects.deepEquals(this.timespan, other.timespan) && Objects.deepEquals(this.at, other.at) && Objects.deepEquals(this.lan, other.lan) && Objects.deepEquals(this.bytes, other.bytes); } @Override public int hashCode() { return Objects.hash( accountID, deviceID, timespan, at, lan, bytes); } @Override public String toString() { return Utils.toString(StatisticsBandwidth.class, "accountID", accountID, "deviceID", deviceID, "timespan", timespan, "at", at, "lan", lan, "bytes", bytes); } public final static class Builder { private Optional accountID = Optional.empty(); private Optional deviceID = Optional.empty(); private Optional timespan = Optional.empty(); private Optional at = Optional.empty(); private Optional lan = Optional.empty(); private Optional bytes = Optional.empty(); private Builder() { // force use of static builder() method } public Builder accountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = Optional.ofNullable(accountID); return this; } public Builder accountID(Optional accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = accountID; return this; } public Builder deviceID(int deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = Optional.ofNullable(deviceID); return this; } public Builder deviceID(Optional deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = deviceID; return this; } public Builder timespan(long timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = Optional.ofNullable(timespan); return this; } public Builder timespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; return this; } public Builder at(int at) { Utils.checkNotNull(at, "at"); this.at = Optional.ofNullable(at); return this; } public Builder at(Optional at) { Utils.checkNotNull(at, "at"); this.at = at; return this; } public Builder lan(boolean lan) { Utils.checkNotNull(lan, "lan"); this.lan = Optional.ofNullable(lan); return this; } public Builder lan(Optional lan) { Utils.checkNotNull(lan, "lan"); this.lan = lan; return this; } public Builder bytes(long bytes) { Utils.checkNotNull(bytes, "bytes"); this.bytes = Optional.ofNullable(bytes); return this; } public Builder bytes(Optional bytes) { Utils.checkNotNull(bytes, "bytes"); this.bytes = bytes; return this; } public StatisticsBandwidth build() { return new StatisticsBandwidth( accountID, deviceID, timespan, at, lan, bytes); } } }