|
| 1 | +// File generated from our OpenAPI spec by Stainless. |
| 2 | + |
| 3 | +package com.tryfinch.api.models |
| 4 | + |
| 5 | +import com.fasterxml.jackson.annotation.JsonAnyGetter |
| 6 | +import com.fasterxml.jackson.annotation.JsonAnySetter |
| 7 | +import com.fasterxml.jackson.annotation.JsonProperty |
| 8 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize |
| 9 | +import com.tryfinch.api.core.ExcludeMissing |
| 10 | +import com.tryfinch.api.core.JsonField |
| 11 | +import com.tryfinch.api.core.JsonMissing |
| 12 | +import com.tryfinch.api.core.JsonValue |
| 13 | +import com.tryfinch.api.core.NoAutoDetect |
| 14 | +import com.tryfinch.api.core.toUnmodifiable |
| 15 | +import java.util.Objects |
| 16 | +import java.util.Optional |
| 17 | + |
| 18 | +/** |
| 19 | + * Each benefit type and their supported features. If the benefit type is not supported, the |
| 20 | + * property will be null |
| 21 | + */ |
| 22 | +@JsonDeserialize(builder = BenefitsSupport.Builder::class) |
| 23 | +@NoAutoDetect |
| 24 | +class BenefitsSupport |
| 25 | +private constructor( |
| 26 | + private val s125Medical: JsonField<BenefitFeaturesAndOperations>, |
| 27 | + private val s125Dental: JsonField<BenefitFeaturesAndOperations>, |
| 28 | + private val s125Vision: JsonField<BenefitFeaturesAndOperations>, |
| 29 | + private val hsaPre: JsonField<BenefitFeaturesAndOperations>, |
| 30 | + private val hsaPost: JsonField<BenefitFeaturesAndOperations>, |
| 31 | + private val fsaMedical: JsonField<BenefitFeaturesAndOperations>, |
| 32 | + private val fsaDependentCare: JsonField<BenefitFeaturesAndOperations>, |
| 33 | + private val simpleIra: JsonField<BenefitFeaturesAndOperations>, |
| 34 | + private val simple: JsonField<BenefitFeaturesAndOperations>, |
| 35 | + private val commuter: JsonField<BenefitFeaturesAndOperations>, |
| 36 | + private val customPostTax: JsonField<BenefitFeaturesAndOperations>, |
| 37 | + private val customPreTax: JsonField<BenefitFeaturesAndOperations>, |
| 38 | + private val additionalProperties: Map<String, JsonValue>, |
| 39 | +) { |
| 40 | + |
| 41 | + private var validated: Boolean = false |
| 42 | + |
| 43 | + private var hashCode: Int = 0 |
| 44 | + |
| 45 | + fun s125Medical(): Optional<BenefitFeaturesAndOperations> = |
| 46 | + Optional.ofNullable(s125Medical.getNullable("s125_medical")) |
| 47 | + |
| 48 | + fun s125Dental(): Optional<BenefitFeaturesAndOperations> = |
| 49 | + Optional.ofNullable(s125Dental.getNullable("s125_dental")) |
| 50 | + |
| 51 | + fun s125Vision(): Optional<BenefitFeaturesAndOperations> = |
| 52 | + Optional.ofNullable(s125Vision.getNullable("s125_vision")) |
| 53 | + |
| 54 | + fun hsaPre(): Optional<BenefitFeaturesAndOperations> = |
| 55 | + Optional.ofNullable(hsaPre.getNullable("hsa_pre")) |
| 56 | + |
| 57 | + fun hsaPost(): Optional<BenefitFeaturesAndOperations> = |
| 58 | + Optional.ofNullable(hsaPost.getNullable("hsa_post")) |
| 59 | + |
| 60 | + fun fsaMedical(): Optional<BenefitFeaturesAndOperations> = |
| 61 | + Optional.ofNullable(fsaMedical.getNullable("fsa_medical")) |
| 62 | + |
| 63 | + fun fsaDependentCare(): Optional<BenefitFeaturesAndOperations> = |
| 64 | + Optional.ofNullable(fsaDependentCare.getNullable("fsa_dependent_care")) |
| 65 | + |
| 66 | + fun simpleIra(): Optional<BenefitFeaturesAndOperations> = |
| 67 | + Optional.ofNullable(simpleIra.getNullable("simple_ira")) |
| 68 | + |
| 69 | + fun simple(): Optional<BenefitFeaturesAndOperations> = |
| 70 | + Optional.ofNullable(simple.getNullable("simple")) |
| 71 | + |
| 72 | + fun commuter(): Optional<BenefitFeaturesAndOperations> = |
| 73 | + Optional.ofNullable(commuter.getNullable("commuter")) |
| 74 | + |
| 75 | + fun customPostTax(): Optional<BenefitFeaturesAndOperations> = |
| 76 | + Optional.ofNullable(customPostTax.getNullable("custom_post_tax")) |
| 77 | + |
| 78 | + fun customPreTax(): Optional<BenefitFeaturesAndOperations> = |
| 79 | + Optional.ofNullable(customPreTax.getNullable("custom_pre_tax")) |
| 80 | + |
| 81 | + @JsonProperty("s125_medical") @ExcludeMissing fun _s125Medical() = s125Medical |
| 82 | + |
| 83 | + @JsonProperty("s125_dental") @ExcludeMissing fun _s125Dental() = s125Dental |
| 84 | + |
| 85 | + @JsonProperty("s125_vision") @ExcludeMissing fun _s125Vision() = s125Vision |
| 86 | + |
| 87 | + @JsonProperty("hsa_pre") @ExcludeMissing fun _hsaPre() = hsaPre |
| 88 | + |
| 89 | + @JsonProperty("hsa_post") @ExcludeMissing fun _hsaPost() = hsaPost |
| 90 | + |
| 91 | + @JsonProperty("fsa_medical") @ExcludeMissing fun _fsaMedical() = fsaMedical |
| 92 | + |
| 93 | + @JsonProperty("fsa_dependent_care") @ExcludeMissing fun _fsaDependentCare() = fsaDependentCare |
| 94 | + |
| 95 | + @JsonProperty("simple_ira") @ExcludeMissing fun _simpleIra() = simpleIra |
| 96 | + |
| 97 | + @JsonProperty("simple") @ExcludeMissing fun _simple() = simple |
| 98 | + |
| 99 | + @JsonProperty("commuter") @ExcludeMissing fun _commuter() = commuter |
| 100 | + |
| 101 | + @JsonProperty("custom_post_tax") @ExcludeMissing fun _customPostTax() = customPostTax |
| 102 | + |
| 103 | + @JsonProperty("custom_pre_tax") @ExcludeMissing fun _customPreTax() = customPreTax |
| 104 | + |
| 105 | + @JsonAnyGetter |
| 106 | + @ExcludeMissing |
| 107 | + fun _additionalProperties(): Map<String, JsonValue> = additionalProperties |
| 108 | + |
| 109 | + fun validate(): BenefitsSupport = apply { |
| 110 | + if (!validated) { |
| 111 | + s125Medical().map { it.validate() } |
| 112 | + s125Dental().map { it.validate() } |
| 113 | + s125Vision().map { it.validate() } |
| 114 | + hsaPre().map { it.validate() } |
| 115 | + hsaPost().map { it.validate() } |
| 116 | + fsaMedical().map { it.validate() } |
| 117 | + fsaDependentCare().map { it.validate() } |
| 118 | + simpleIra().map { it.validate() } |
| 119 | + simple().map { it.validate() } |
| 120 | + commuter().map { it.validate() } |
| 121 | + customPostTax().map { it.validate() } |
| 122 | + customPreTax().map { it.validate() } |
| 123 | + validated = true |
| 124 | + } |
| 125 | + } |
| 126 | + |
| 127 | + fun toBuilder() = Builder().from(this) |
| 128 | + |
| 129 | + override fun equals(other: Any?): Boolean { |
| 130 | + if (this === other) { |
| 131 | + return true |
| 132 | + } |
| 133 | + |
| 134 | + return other is BenefitsSupport && |
| 135 | + this.s125Medical == other.s125Medical && |
| 136 | + this.s125Dental == other.s125Dental && |
| 137 | + this.s125Vision == other.s125Vision && |
| 138 | + this.hsaPre == other.hsaPre && |
| 139 | + this.hsaPost == other.hsaPost && |
| 140 | + this.fsaMedical == other.fsaMedical && |
| 141 | + this.fsaDependentCare == other.fsaDependentCare && |
| 142 | + this.simpleIra == other.simpleIra && |
| 143 | + this.simple == other.simple && |
| 144 | + this.commuter == other.commuter && |
| 145 | + this.customPostTax == other.customPostTax && |
| 146 | + this.customPreTax == other.customPreTax && |
| 147 | + this.additionalProperties == other.additionalProperties |
| 148 | + } |
| 149 | + |
| 150 | + override fun hashCode(): Int { |
| 151 | + if (hashCode == 0) { |
| 152 | + hashCode = |
| 153 | + Objects.hash( |
| 154 | + s125Medical, |
| 155 | + s125Dental, |
| 156 | + s125Vision, |
| 157 | + hsaPre, |
| 158 | + hsaPost, |
| 159 | + fsaMedical, |
| 160 | + fsaDependentCare, |
| 161 | + simpleIra, |
| 162 | + simple, |
| 163 | + commuter, |
| 164 | + customPostTax, |
| 165 | + customPreTax, |
| 166 | + additionalProperties, |
| 167 | + ) |
| 168 | + } |
| 169 | + return hashCode |
| 170 | + } |
| 171 | + |
| 172 | + override fun toString() = |
| 173 | + "BenefitsSupport{s125Medical=$s125Medical, s125Dental=$s125Dental, s125Vision=$s125Vision, hsaPre=$hsaPre, hsaPost=$hsaPost, fsaMedical=$fsaMedical, fsaDependentCare=$fsaDependentCare, simpleIra=$simpleIra, simple=$simple, commuter=$commuter, customPostTax=$customPostTax, customPreTax=$customPreTax, additionalProperties=$additionalProperties}" |
| 174 | + |
| 175 | + companion object { |
| 176 | + |
| 177 | + @JvmStatic fun builder() = Builder() |
| 178 | + } |
| 179 | + |
| 180 | + class Builder { |
| 181 | + |
| 182 | + private var s125Medical: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 183 | + private var s125Dental: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 184 | + private var s125Vision: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 185 | + private var hsaPre: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 186 | + private var hsaPost: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 187 | + private var fsaMedical: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 188 | + private var fsaDependentCare: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 189 | + private var simpleIra: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 190 | + private var simple: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 191 | + private var commuter: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 192 | + private var customPostTax: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 193 | + private var customPreTax: JsonField<BenefitFeaturesAndOperations> = JsonMissing.of() |
| 194 | + private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() |
| 195 | + |
| 196 | + @JvmSynthetic |
| 197 | + internal fun from(benefitsSupport: BenefitsSupport) = apply { |
| 198 | + this.s125Medical = benefitsSupport.s125Medical |
| 199 | + this.s125Dental = benefitsSupport.s125Dental |
| 200 | + this.s125Vision = benefitsSupport.s125Vision |
| 201 | + this.hsaPre = benefitsSupport.hsaPre |
| 202 | + this.hsaPost = benefitsSupport.hsaPost |
| 203 | + this.fsaMedical = benefitsSupport.fsaMedical |
| 204 | + this.fsaDependentCare = benefitsSupport.fsaDependentCare |
| 205 | + this.simpleIra = benefitsSupport.simpleIra |
| 206 | + this.simple = benefitsSupport.simple |
| 207 | + this.commuter = benefitsSupport.commuter |
| 208 | + this.customPostTax = benefitsSupport.customPostTax |
| 209 | + this.customPreTax = benefitsSupport.customPreTax |
| 210 | + additionalProperties(benefitsSupport.additionalProperties) |
| 211 | + } |
| 212 | + |
| 213 | + fun s125Medical(s125Medical: BenefitFeaturesAndOperations) = |
| 214 | + s125Medical(JsonField.of(s125Medical)) |
| 215 | + |
| 216 | + @JsonProperty("s125_medical") |
| 217 | + @ExcludeMissing |
| 218 | + fun s125Medical(s125Medical: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 219 | + this.s125Medical = s125Medical |
| 220 | + } |
| 221 | + |
| 222 | + fun s125Dental(s125Dental: BenefitFeaturesAndOperations) = |
| 223 | + s125Dental(JsonField.of(s125Dental)) |
| 224 | + |
| 225 | + @JsonProperty("s125_dental") |
| 226 | + @ExcludeMissing |
| 227 | + fun s125Dental(s125Dental: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 228 | + this.s125Dental = s125Dental |
| 229 | + } |
| 230 | + |
| 231 | + fun s125Vision(s125Vision: BenefitFeaturesAndOperations) = |
| 232 | + s125Vision(JsonField.of(s125Vision)) |
| 233 | + |
| 234 | + @JsonProperty("s125_vision") |
| 235 | + @ExcludeMissing |
| 236 | + fun s125Vision(s125Vision: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 237 | + this.s125Vision = s125Vision |
| 238 | + } |
| 239 | + |
| 240 | + fun hsaPre(hsaPre: BenefitFeaturesAndOperations) = hsaPre(JsonField.of(hsaPre)) |
| 241 | + |
| 242 | + @JsonProperty("hsa_pre") |
| 243 | + @ExcludeMissing |
| 244 | + fun hsaPre(hsaPre: JsonField<BenefitFeaturesAndOperations>) = apply { this.hsaPre = hsaPre } |
| 245 | + |
| 246 | + fun hsaPost(hsaPost: BenefitFeaturesAndOperations) = hsaPost(JsonField.of(hsaPost)) |
| 247 | + |
| 248 | + @JsonProperty("hsa_post") |
| 249 | + @ExcludeMissing |
| 250 | + fun hsaPost(hsaPost: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 251 | + this.hsaPost = hsaPost |
| 252 | + } |
| 253 | + |
| 254 | + fun fsaMedical(fsaMedical: BenefitFeaturesAndOperations) = |
| 255 | + fsaMedical(JsonField.of(fsaMedical)) |
| 256 | + |
| 257 | + @JsonProperty("fsa_medical") |
| 258 | + @ExcludeMissing |
| 259 | + fun fsaMedical(fsaMedical: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 260 | + this.fsaMedical = fsaMedical |
| 261 | + } |
| 262 | + |
| 263 | + fun fsaDependentCare(fsaDependentCare: BenefitFeaturesAndOperations) = |
| 264 | + fsaDependentCare(JsonField.of(fsaDependentCare)) |
| 265 | + |
| 266 | + @JsonProperty("fsa_dependent_care") |
| 267 | + @ExcludeMissing |
| 268 | + fun fsaDependentCare(fsaDependentCare: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 269 | + this.fsaDependentCare = fsaDependentCare |
| 270 | + } |
| 271 | + |
| 272 | + fun simpleIra(simpleIra: BenefitFeaturesAndOperations) = simpleIra(JsonField.of(simpleIra)) |
| 273 | + |
| 274 | + @JsonProperty("simple_ira") |
| 275 | + @ExcludeMissing |
| 276 | + fun simpleIra(simpleIra: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 277 | + this.simpleIra = simpleIra |
| 278 | + } |
| 279 | + |
| 280 | + fun simple(simple: BenefitFeaturesAndOperations) = simple(JsonField.of(simple)) |
| 281 | + |
| 282 | + @JsonProperty("simple") |
| 283 | + @ExcludeMissing |
| 284 | + fun simple(simple: JsonField<BenefitFeaturesAndOperations>) = apply { this.simple = simple } |
| 285 | + |
| 286 | + fun commuter(commuter: BenefitFeaturesAndOperations) = commuter(JsonField.of(commuter)) |
| 287 | + |
| 288 | + @JsonProperty("commuter") |
| 289 | + @ExcludeMissing |
| 290 | + fun commuter(commuter: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 291 | + this.commuter = commuter |
| 292 | + } |
| 293 | + |
| 294 | + fun customPostTax(customPostTax: BenefitFeaturesAndOperations) = |
| 295 | + customPostTax(JsonField.of(customPostTax)) |
| 296 | + |
| 297 | + @JsonProperty("custom_post_tax") |
| 298 | + @ExcludeMissing |
| 299 | + fun customPostTax(customPostTax: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 300 | + this.customPostTax = customPostTax |
| 301 | + } |
| 302 | + |
| 303 | + fun customPreTax(customPreTax: BenefitFeaturesAndOperations) = |
| 304 | + customPreTax(JsonField.of(customPreTax)) |
| 305 | + |
| 306 | + @JsonProperty("custom_pre_tax") |
| 307 | + @ExcludeMissing |
| 308 | + fun customPreTax(customPreTax: JsonField<BenefitFeaturesAndOperations>) = apply { |
| 309 | + this.customPreTax = customPreTax |
| 310 | + } |
| 311 | + |
| 312 | + fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply { |
| 313 | + this.additionalProperties.clear() |
| 314 | + this.additionalProperties.putAll(additionalProperties) |
| 315 | + } |
| 316 | + |
| 317 | + @JsonAnySetter |
| 318 | + fun putAdditionalProperty(key: String, value: JsonValue) = apply { |
| 319 | + this.additionalProperties.put(key, value) |
| 320 | + } |
| 321 | + |
| 322 | + fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply { |
| 323 | + this.additionalProperties.putAll(additionalProperties) |
| 324 | + } |
| 325 | + |
| 326 | + fun build(): BenefitsSupport = |
| 327 | + BenefitsSupport( |
| 328 | + s125Medical, |
| 329 | + s125Dental, |
| 330 | + s125Vision, |
| 331 | + hsaPre, |
| 332 | + hsaPost, |
| 333 | + fsaMedical, |
| 334 | + fsaDependentCare, |
| 335 | + simpleIra, |
| 336 | + simple, |
| 337 | + commuter, |
| 338 | + customPostTax, |
| 339 | + customPreTax, |
| 340 | + additionalProperties.toUnmodifiable(), |
| 341 | + ) |
| 342 | + } |
| 343 | +} |
0 commit comments