All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tryfinch.api.models.BenefitsSupport.kt Maven / Gradle / Ivy

Go to download

The Finch HRIS API provides a unified way to connect to a multitide of HRIS systems. The API requires an access token issued by Finch. By default, Organization and Payroll requests use Finch's [Data Syncs](/developer-resources/Data-Syncs). If a request is made before the initial sync has completed, Finch will request data live from the provider. The latency on live requests may range from seconds to minutes depending on the provider and batch size. For automated integrations, Deductions requests (both read and write) are always made live to the provider. Latencies may range from seconds to minutes depending on the provider and batch size. Employer products are specified by the product parameter, a space-separated list of products that your application requests from an employer authenticating through Finch Connect. Valid product names are— - `company`: Read basic company data - `directory`: Read company directory and organization structure - `individual`: Read individual data, excluding income and employment data - `employment`: Read individual employment and income data - `payment`: Read payroll and contractor related payments by the company - `pay_statement`: Read detailed pay statements for each individual - `benefits`: Create and manage deductions and contributions and enrollment for an employer [![Open in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)

There is a newer version: 1.11.0
Show newest version
// File generated from our OpenAPI spec by Stainless.

package com.tryfinch.api.models

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.tryfinch.api.core.ExcludeMissing
import com.tryfinch.api.core.JsonField
import com.tryfinch.api.core.JsonMissing
import com.tryfinch.api.core.JsonValue
import com.tryfinch.api.core.NoAutoDetect
import com.tryfinch.api.core.toUnmodifiable
import java.util.Objects
import java.util.Optional

/**
 * Each benefit type and their supported features. If the benefit type is not supported, the
 * property will be null
 */
@JsonDeserialize(builder = BenefitsSupport.Builder::class)
@NoAutoDetect
class BenefitsSupport
private constructor(
    private val s125Medical: JsonField,
    private val s125Dental: JsonField,
    private val s125Vision: JsonField,
    private val hsaPre: JsonField,
    private val hsaPost: JsonField,
    private val fsaMedical: JsonField,
    private val fsaDependentCare: JsonField,
    private val simpleIra: JsonField,
    private val simple: JsonField,
    private val commuter: JsonField,
    private val customPostTax: JsonField,
    private val customPreTax: JsonField,
    private val additionalProperties: Map,
) {

    private var validated: Boolean = false

    private var hashCode: Int = 0

    fun s125Medical(): Optional =
        Optional.ofNullable(s125Medical.getNullable("s125_medical"))

    fun s125Dental(): Optional =
        Optional.ofNullable(s125Dental.getNullable("s125_dental"))

    fun s125Vision(): Optional =
        Optional.ofNullable(s125Vision.getNullable("s125_vision"))

    fun hsaPre(): Optional =
        Optional.ofNullable(hsaPre.getNullable("hsa_pre"))

    fun hsaPost(): Optional =
        Optional.ofNullable(hsaPost.getNullable("hsa_post"))

    fun fsaMedical(): Optional =
        Optional.ofNullable(fsaMedical.getNullable("fsa_medical"))

    fun fsaDependentCare(): Optional =
        Optional.ofNullable(fsaDependentCare.getNullable("fsa_dependent_care"))

    fun simpleIra(): Optional =
        Optional.ofNullable(simpleIra.getNullable("simple_ira"))

    fun simple(): Optional =
        Optional.ofNullable(simple.getNullable("simple"))

    fun commuter(): Optional =
        Optional.ofNullable(commuter.getNullable("commuter"))

    fun customPostTax(): Optional =
        Optional.ofNullable(customPostTax.getNullable("custom_post_tax"))

    fun customPreTax(): Optional =
        Optional.ofNullable(customPreTax.getNullable("custom_pre_tax"))

    @JsonProperty("s125_medical") @ExcludeMissing fun _s125Medical() = s125Medical

    @JsonProperty("s125_dental") @ExcludeMissing fun _s125Dental() = s125Dental

    @JsonProperty("s125_vision") @ExcludeMissing fun _s125Vision() = s125Vision

    @JsonProperty("hsa_pre") @ExcludeMissing fun _hsaPre() = hsaPre

    @JsonProperty("hsa_post") @ExcludeMissing fun _hsaPost() = hsaPost

    @JsonProperty("fsa_medical") @ExcludeMissing fun _fsaMedical() = fsaMedical

    @JsonProperty("fsa_dependent_care") @ExcludeMissing fun _fsaDependentCare() = fsaDependentCare

    @JsonProperty("simple_ira") @ExcludeMissing fun _simpleIra() = simpleIra

    @JsonProperty("simple") @ExcludeMissing fun _simple() = simple

    @JsonProperty("commuter") @ExcludeMissing fun _commuter() = commuter

    @JsonProperty("custom_post_tax") @ExcludeMissing fun _customPostTax() = customPostTax

    @JsonProperty("custom_pre_tax") @ExcludeMissing fun _customPreTax() = customPreTax

    @JsonAnyGetter
    @ExcludeMissing
    fun _additionalProperties(): Map = additionalProperties

    fun validate(): BenefitsSupport = apply {
        if (!validated) {
            s125Medical().map { it.validate() }
            s125Dental().map { it.validate() }
            s125Vision().map { it.validate() }
            hsaPre().map { it.validate() }
            hsaPost().map { it.validate() }
            fsaMedical().map { it.validate() }
            fsaDependentCare().map { it.validate() }
            simpleIra().map { it.validate() }
            simple().map { it.validate() }
            commuter().map { it.validate() }
            customPostTax().map { it.validate() }
            customPreTax().map { it.validate() }
            validated = true
        }
    }

    fun toBuilder() = Builder().from(this)

    override fun equals(other: Any?): Boolean {
        if (this === other) {
            return true
        }

        return other is BenefitsSupport &&
            this.s125Medical == other.s125Medical &&
            this.s125Dental == other.s125Dental &&
            this.s125Vision == other.s125Vision &&
            this.hsaPre == other.hsaPre &&
            this.hsaPost == other.hsaPost &&
            this.fsaMedical == other.fsaMedical &&
            this.fsaDependentCare == other.fsaDependentCare &&
            this.simpleIra == other.simpleIra &&
            this.simple == other.simple &&
            this.commuter == other.commuter &&
            this.customPostTax == other.customPostTax &&
            this.customPreTax == other.customPreTax &&
            this.additionalProperties == other.additionalProperties
    }

    override fun hashCode(): Int {
        if (hashCode == 0) {
            hashCode =
                Objects.hash(
                    s125Medical,
                    s125Dental,
                    s125Vision,
                    hsaPre,
                    hsaPost,
                    fsaMedical,
                    fsaDependentCare,
                    simpleIra,
                    simple,
                    commuter,
                    customPostTax,
                    customPreTax,
                    additionalProperties,
                )
        }
        return hashCode
    }

    override fun toString() =
        "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}"

    companion object {

        @JvmStatic fun builder() = Builder()
    }

    class Builder {

        private var s125Medical: JsonField = JsonMissing.of()
        private var s125Dental: JsonField = JsonMissing.of()
        private var s125Vision: JsonField = JsonMissing.of()
        private var hsaPre: JsonField = JsonMissing.of()
        private var hsaPost: JsonField = JsonMissing.of()
        private var fsaMedical: JsonField = JsonMissing.of()
        private var fsaDependentCare: JsonField = JsonMissing.of()
        private var simpleIra: JsonField = JsonMissing.of()
        private var simple: JsonField = JsonMissing.of()
        private var commuter: JsonField = JsonMissing.of()
        private var customPostTax: JsonField = JsonMissing.of()
        private var customPreTax: JsonField = JsonMissing.of()
        private var additionalProperties: MutableMap = mutableMapOf()

        @JvmSynthetic
        internal fun from(benefitsSupport: BenefitsSupport) = apply {
            this.s125Medical = benefitsSupport.s125Medical
            this.s125Dental = benefitsSupport.s125Dental
            this.s125Vision = benefitsSupport.s125Vision
            this.hsaPre = benefitsSupport.hsaPre
            this.hsaPost = benefitsSupport.hsaPost
            this.fsaMedical = benefitsSupport.fsaMedical
            this.fsaDependentCare = benefitsSupport.fsaDependentCare
            this.simpleIra = benefitsSupport.simpleIra
            this.simple = benefitsSupport.simple
            this.commuter = benefitsSupport.commuter
            this.customPostTax = benefitsSupport.customPostTax
            this.customPreTax = benefitsSupport.customPreTax
            additionalProperties(benefitsSupport.additionalProperties)
        }

        fun s125Medical(s125Medical: BenefitFeaturesAndOperations) =
            s125Medical(JsonField.of(s125Medical))

        @JsonProperty("s125_medical")
        @ExcludeMissing
        fun s125Medical(s125Medical: JsonField) = apply {
            this.s125Medical = s125Medical
        }

        fun s125Dental(s125Dental: BenefitFeaturesAndOperations) =
            s125Dental(JsonField.of(s125Dental))

        @JsonProperty("s125_dental")
        @ExcludeMissing
        fun s125Dental(s125Dental: JsonField) = apply {
            this.s125Dental = s125Dental
        }

        fun s125Vision(s125Vision: BenefitFeaturesAndOperations) =
            s125Vision(JsonField.of(s125Vision))

        @JsonProperty("s125_vision")
        @ExcludeMissing
        fun s125Vision(s125Vision: JsonField) = apply {
            this.s125Vision = s125Vision
        }

        fun hsaPre(hsaPre: BenefitFeaturesAndOperations) = hsaPre(JsonField.of(hsaPre))

        @JsonProperty("hsa_pre")
        @ExcludeMissing
        fun hsaPre(hsaPre: JsonField) = apply { this.hsaPre = hsaPre }

        fun hsaPost(hsaPost: BenefitFeaturesAndOperations) = hsaPost(JsonField.of(hsaPost))

        @JsonProperty("hsa_post")
        @ExcludeMissing
        fun hsaPost(hsaPost: JsonField) = apply {
            this.hsaPost = hsaPost
        }

        fun fsaMedical(fsaMedical: BenefitFeaturesAndOperations) =
            fsaMedical(JsonField.of(fsaMedical))

        @JsonProperty("fsa_medical")
        @ExcludeMissing
        fun fsaMedical(fsaMedical: JsonField) = apply {
            this.fsaMedical = fsaMedical
        }

        fun fsaDependentCare(fsaDependentCare: BenefitFeaturesAndOperations) =
            fsaDependentCare(JsonField.of(fsaDependentCare))

        @JsonProperty("fsa_dependent_care")
        @ExcludeMissing
        fun fsaDependentCare(fsaDependentCare: JsonField) = apply {
            this.fsaDependentCare = fsaDependentCare
        }

        fun simpleIra(simpleIra: BenefitFeaturesAndOperations) = simpleIra(JsonField.of(simpleIra))

        @JsonProperty("simple_ira")
        @ExcludeMissing
        fun simpleIra(simpleIra: JsonField) = apply {
            this.simpleIra = simpleIra
        }

        fun simple(simple: BenefitFeaturesAndOperations) = simple(JsonField.of(simple))

        @JsonProperty("simple")
        @ExcludeMissing
        fun simple(simple: JsonField) = apply { this.simple = simple }

        fun commuter(commuter: BenefitFeaturesAndOperations) = commuter(JsonField.of(commuter))

        @JsonProperty("commuter")
        @ExcludeMissing
        fun commuter(commuter: JsonField) = apply {
            this.commuter = commuter
        }

        fun customPostTax(customPostTax: BenefitFeaturesAndOperations) =
            customPostTax(JsonField.of(customPostTax))

        @JsonProperty("custom_post_tax")
        @ExcludeMissing
        fun customPostTax(customPostTax: JsonField) = apply {
            this.customPostTax = customPostTax
        }

        fun customPreTax(customPreTax: BenefitFeaturesAndOperations) =
            customPreTax(JsonField.of(customPreTax))

        @JsonProperty("custom_pre_tax")
        @ExcludeMissing
        fun customPreTax(customPreTax: JsonField) = apply {
            this.customPreTax = customPreTax
        }

        fun additionalProperties(additionalProperties: Map) = apply {
            this.additionalProperties.clear()
            this.additionalProperties.putAll(additionalProperties)
        }

        @JsonAnySetter
        fun putAdditionalProperty(key: String, value: JsonValue) = apply {
            this.additionalProperties.put(key, value)
        }

        fun putAllAdditionalProperties(additionalProperties: Map) = apply {
            this.additionalProperties.putAll(additionalProperties)
        }

        fun build(): BenefitsSupport =
            BenefitsSupport(
                s125Medical,
                s125Dental,
                s125Vision,
                hsaPre,
                hsaPost,
                fsaMedical,
                fsaDependentCare,
                simpleIra,
                simple,
                commuter,
                customPostTax,
                customPreTax,
                additionalProperties.toUnmodifiable(),
            )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy