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