|
| 1 | +/** |
| 2 | + * This file was auto-generated by Fern from our API Definition. |
| 3 | + */ |
| 4 | +package com.seam.api.resources.thermostats.requests; |
| 5 | + |
| 6 | +import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| 7 | +import com.fasterxml.jackson.annotation.JsonAnySetter; |
| 8 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 9 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 10 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 11 | +import com.fasterxml.jackson.annotation.JsonSetter; |
| 12 | +import com.fasterxml.jackson.annotation.Nulls; |
| 13 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 14 | +import com.seam.api.core.ObjectMappers; |
| 15 | +import com.seam.api.types.FanModeSetting; |
| 16 | +import java.util.HashMap; |
| 17 | +import java.util.Map; |
| 18 | +import java.util.Objects; |
| 19 | +import java.util.Optional; |
| 20 | + |
| 21 | +@JsonInclude(JsonInclude.Include.NON_EMPTY) |
| 22 | +@JsonDeserialize(builder = ThermostatsSetFanModeRequest.Builder.class) |
| 23 | +public final class ThermostatsSetFanModeRequest { |
| 24 | + private final String deviceId; |
| 25 | + |
| 26 | + private final Optional<FanModeSetting> fanMode; |
| 27 | + |
| 28 | + private final Optional<FanModeSetting> fanModeSetting; |
| 29 | + |
| 30 | + private final Optional<Boolean> sync; |
| 31 | + |
| 32 | + private final Map<String, Object> additionalProperties; |
| 33 | + |
| 34 | + private ThermostatsSetFanModeRequest( |
| 35 | + String deviceId, |
| 36 | + Optional<FanModeSetting> fanMode, |
| 37 | + Optional<FanModeSetting> fanModeSetting, |
| 38 | + Optional<Boolean> sync, |
| 39 | + Map<String, Object> additionalProperties) { |
| 40 | + this.deviceId = deviceId; |
| 41 | + this.fanMode = fanMode; |
| 42 | + this.fanModeSetting = fanModeSetting; |
| 43 | + this.sync = sync; |
| 44 | + this.additionalProperties = additionalProperties; |
| 45 | + } |
| 46 | + |
| 47 | + @JsonProperty("device_id") |
| 48 | + public String getDeviceId() { |
| 49 | + return deviceId; |
| 50 | + } |
| 51 | + |
| 52 | + @JsonProperty("fan_mode") |
| 53 | + public Optional<FanModeSetting> getFanMode() { |
| 54 | + return fanMode; |
| 55 | + } |
| 56 | + |
| 57 | + @JsonProperty("fan_mode_setting") |
| 58 | + public Optional<FanModeSetting> getFanModeSetting() { |
| 59 | + return fanModeSetting; |
| 60 | + } |
| 61 | + |
| 62 | + @JsonProperty("sync") |
| 63 | + public Optional<Boolean> getSync() { |
| 64 | + return sync; |
| 65 | + } |
| 66 | + |
| 67 | + @Override |
| 68 | + public boolean equals(Object other) { |
| 69 | + if (this == other) return true; |
| 70 | + return other instanceof ThermostatsSetFanModeRequest && equalTo((ThermostatsSetFanModeRequest) other); |
| 71 | + } |
| 72 | + |
| 73 | + @JsonAnyGetter |
| 74 | + public Map<String, Object> getAdditionalProperties() { |
| 75 | + return this.additionalProperties; |
| 76 | + } |
| 77 | + |
| 78 | + private boolean equalTo(ThermostatsSetFanModeRequest other) { |
| 79 | + return deviceId.equals(other.deviceId) |
| 80 | + && fanMode.equals(other.fanMode) |
| 81 | + && fanModeSetting.equals(other.fanModeSetting) |
| 82 | + && sync.equals(other.sync); |
| 83 | + } |
| 84 | + |
| 85 | + @Override |
| 86 | + public int hashCode() { |
| 87 | + return Objects.hash(this.deviceId, this.fanMode, this.fanModeSetting, this.sync); |
| 88 | + } |
| 89 | + |
| 90 | + @Override |
| 91 | + public String toString() { |
| 92 | + return ObjectMappers.stringify(this); |
| 93 | + } |
| 94 | + |
| 95 | + public static DeviceIdStage builder() { |
| 96 | + return new Builder(); |
| 97 | + } |
| 98 | + |
| 99 | + public interface DeviceIdStage { |
| 100 | + _FinalStage deviceId(String deviceId); |
| 101 | + |
| 102 | + Builder from(ThermostatsSetFanModeRequest other); |
| 103 | + } |
| 104 | + |
| 105 | + public interface _FinalStage { |
| 106 | + ThermostatsSetFanModeRequest build(); |
| 107 | + |
| 108 | + _FinalStage fanMode(Optional<FanModeSetting> fanMode); |
| 109 | + |
| 110 | + _FinalStage fanMode(FanModeSetting fanMode); |
| 111 | + |
| 112 | + _FinalStage fanModeSetting(Optional<FanModeSetting> fanModeSetting); |
| 113 | + |
| 114 | + _FinalStage fanModeSetting(FanModeSetting fanModeSetting); |
| 115 | + |
| 116 | + _FinalStage sync(Optional<Boolean> sync); |
| 117 | + |
| 118 | + _FinalStage sync(Boolean sync); |
| 119 | + } |
| 120 | + |
| 121 | + @JsonIgnoreProperties(ignoreUnknown = true) |
| 122 | + public static final class Builder implements DeviceIdStage, _FinalStage { |
| 123 | + private String deviceId; |
| 124 | + |
| 125 | + private Optional<Boolean> sync = Optional.empty(); |
| 126 | + |
| 127 | + private Optional<FanModeSetting> fanModeSetting = Optional.empty(); |
| 128 | + |
| 129 | + private Optional<FanModeSetting> fanMode = Optional.empty(); |
| 130 | + |
| 131 | + @JsonAnySetter |
| 132 | + private Map<String, Object> additionalProperties = new HashMap<>(); |
| 133 | + |
| 134 | + private Builder() {} |
| 135 | + |
| 136 | + @Override |
| 137 | + public Builder from(ThermostatsSetFanModeRequest other) { |
| 138 | + deviceId(other.getDeviceId()); |
| 139 | + fanMode(other.getFanMode()); |
| 140 | + fanModeSetting(other.getFanModeSetting()); |
| 141 | + sync(other.getSync()); |
| 142 | + return this; |
| 143 | + } |
| 144 | + |
| 145 | + @Override |
| 146 | + @JsonSetter("device_id") |
| 147 | + public _FinalStage deviceId(String deviceId) { |
| 148 | + this.deviceId = deviceId; |
| 149 | + return this; |
| 150 | + } |
| 151 | + |
| 152 | + @Override |
| 153 | + public _FinalStage sync(Boolean sync) { |
| 154 | + this.sync = Optional.of(sync); |
| 155 | + return this; |
| 156 | + } |
| 157 | + |
| 158 | + @Override |
| 159 | + @JsonSetter(value = "sync", nulls = Nulls.SKIP) |
| 160 | + public _FinalStage sync(Optional<Boolean> sync) { |
| 161 | + this.sync = sync; |
| 162 | + return this; |
| 163 | + } |
| 164 | + |
| 165 | + @Override |
| 166 | + public _FinalStage fanModeSetting(FanModeSetting fanModeSetting) { |
| 167 | + this.fanModeSetting = Optional.of(fanModeSetting); |
| 168 | + return this; |
| 169 | + } |
| 170 | + |
| 171 | + @Override |
| 172 | + @JsonSetter(value = "fan_mode_setting", nulls = Nulls.SKIP) |
| 173 | + public _FinalStage fanModeSetting(Optional<FanModeSetting> fanModeSetting) { |
| 174 | + this.fanModeSetting = fanModeSetting; |
| 175 | + return this; |
| 176 | + } |
| 177 | + |
| 178 | + @Override |
| 179 | + public _FinalStage fanMode(FanModeSetting fanMode) { |
| 180 | + this.fanMode = Optional.of(fanMode); |
| 181 | + return this; |
| 182 | + } |
| 183 | + |
| 184 | + @Override |
| 185 | + @JsonSetter(value = "fan_mode", nulls = Nulls.SKIP) |
| 186 | + public _FinalStage fanMode(Optional<FanModeSetting> fanMode) { |
| 187 | + this.fanMode = fanMode; |
| 188 | + return this; |
| 189 | + } |
| 190 | + |
| 191 | + @Override |
| 192 | + public ThermostatsSetFanModeRequest build() { |
| 193 | + return new ThermostatsSetFanModeRequest(deviceId, fanMode, fanModeSetting, sync, additionalProperties); |
| 194 | + } |
| 195 | + } |
| 196 | +} |
0 commit comments