diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15d08fb0c..0fec3add5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 15 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/finch-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: @@ -42,7 +42,7 @@ jobs: build: timeout-minutes: 15 name: build - runs-on: ${{ github.repository == 'stainless-sdks/finch-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: @@ -66,7 +66,7 @@ jobs: test: timeout-minutes: 15 name: test - runs-on: ${{ github.repository == 'stainless-sdks/finch-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 430e28e56..b7ef03ebe 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "9.3.0" + ".": "9.4.0" } diff --git a/.stats.yml b/.stats.yml index 0fc8637f9..d8dd80b17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 48 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch/finch-166cc05754d8591beda094f4ee6f438f55d5f65d490ab364ea130c5100134375.yml -openapi_spec_hash: 4582a35bbe9fb5404d1e4f804c877fa8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch/finch-bdcc610cd7d5dcb5d3d7598a33957dd673cb81f14ca5d8dc9d41fced4230f114.yml +openapi_spec_hash: 16dce00b8187a592fab5c88efc7bf7fc config_hash: 9ae56f40cec7304896138bfad5caf748 diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c7e861e..7b29db86a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 9.4.0 (2026-07-17) + +Full Changelog: [v9.3.0...v9.4.0](https://github.com/Finch-API/finch-api-kotlin/compare/v9.3.0...v9.4.0) + +### Features + +* **api:** api update ([13ee082](https://github.com/Finch-API/finch-api-kotlin/commit/13ee08204dc152300fe27e7ecf806f3050c5afd8)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([86e69ad](https://github.com/Finch-API/finch-api-kotlin/commit/86e69ada9999bb241d6d367f7fe0fe67e46ad1b2)) + ## 9.3.0 (2026-07-15) Full Changelog: [v9.2.0...v9.3.0](https://github.com/Finch-API/finch-api-kotlin/compare/v9.2.0...v9.3.0) diff --git a/README.md b/README.md index 498504a61..0feb51770 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-kotlin)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-kotlin/9.3.0) -[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-kotlin/9.3.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-kotlin/9.3.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-kotlin)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-kotlin/9.4.0) +[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-kotlin/9.4.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-kotlin/9.4.0) @@ -24,7 +24,7 @@ Use the Finch MCP Server to enable AI assistants to interact with this API, allo -The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). KDocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-kotlin/9.3.0). +The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). KDocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-kotlin/9.4.0). @@ -35,7 +35,7 @@ The REST API documentation can be found on [developer.tryfinch.com](https://deve ### Gradle ```kotlin -implementation("com.tryfinch.api:finch-kotlin:9.3.0") +implementation("com.tryfinch.api:finch-kotlin:9.4.0") ``` ### Maven @@ -44,7 +44,7 @@ implementation("com.tryfinch.api:finch-kotlin:9.3.0") com.tryfinch.api finch-kotlin - 9.3.0 + 9.4.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index e1bb90998..1177b4936 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.tryfinch.api" - version = "9.3.0" // x-release-please-version + version = "9.4.0" // x-release-please-version } subprojects { diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt index 3bceff66c..58815b708 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt @@ -245,7 +245,9 @@ private constructor( private val endDate: JsonField, private val firstName: JsonField, private val flsaStatus: JsonField, + private val highlyCompensatedEmployee: JsonField, private val isActive: JsonField, + private val keyEmployee: JsonField, private val lastName: JsonField, private val latestRehireDate: JsonField, private val location: JsonField, @@ -253,6 +255,8 @@ private constructor( private val middleName: JsonField, private val startDate: JsonField, private val title: JsonField, + private val unionCode: JsonField, + private val unionLocal: JsonField, private val customFields: JsonField>, private val income: JsonField, private val incomeHistory: JsonField>, @@ -283,9 +287,15 @@ private constructor( @JsonProperty("flsa_status") @ExcludeMissing flsaStatus: JsonField = JsonMissing.of(), + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + highlyCompensatedEmployee: JsonField = JsonMissing.of(), @JsonProperty("is_active") @ExcludeMissing isActive: JsonField = JsonMissing.of(), + @JsonProperty("key_employee") + @ExcludeMissing + keyEmployee: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), @@ -303,6 +313,12 @@ private constructor( @ExcludeMissing startDate: JsonField = JsonMissing.of(), @JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(), + @JsonProperty("union_code") + @ExcludeMissing + unionCode: JsonField = JsonMissing.of(), + @JsonProperty("union_local") + @ExcludeMissing + unionLocal: JsonField = JsonMissing.of(), @JsonProperty("custom_fields") @ExcludeMissing customFields: JsonField> = JsonMissing.of(), @@ -323,7 +339,9 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -331,6 +349,8 @@ private constructor( middleName, startDate, title, + unionCode, + unionLocal, customFields, income, incomeHistory, @@ -402,6 +422,16 @@ private constructor( */ fun flsaStatus(): FlsaStatus? = flsaStatus.getNullable("flsa_status") + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee + * for nondiscrimination testing purposes (ADP/ACP tests). US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun highlyCompensatedEmployee(): Boolean? = + highlyCompensatedEmployee.getNullable("highly_compensated_employee") + /** * `true` if the individual an an active employee or contractor at the company. * @@ -410,6 +440,15 @@ private constructor( */ fun isActive(): Boolean? = isActive.getNullable("is_active") + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun keyEmployee(): Boolean? = keyEmployee.getNullable("key_employee") + /** * The legal last name of the individual. * @@ -460,6 +499,23 @@ private constructor( */ fun title(): String? = title.getNullable("title") + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionCode(): String? = unionCode.getNullable("union_code") + + /** + * The local chapter or local number within the employee's union. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionLocal(): String? = unionLocal.getNullable("union_local") + /** * Custom fields for the individual. These are fields which are defined by the employer in * the system. Custom fields are not currently supported for assisted connections. @@ -568,6 +624,16 @@ private constructor( @ExcludeMissing fun _flsaStatus(): JsonField = flsaStatus + /** + * Returns the raw JSON value of [highlyCompensatedEmployee]. + * + * Unlike [highlyCompensatedEmployee], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + fun _highlyCompensatedEmployee(): JsonField = highlyCompensatedEmployee + /** * Returns the raw JSON value of [isActive]. * @@ -575,6 +641,15 @@ private constructor( */ @JsonProperty("is_active") @ExcludeMissing fun _isActive(): JsonField = isActive + /** + * Returns the raw JSON value of [keyEmployee]. + * + * Unlike [keyEmployee], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("key_employee") + @ExcludeMissing + fun _keyEmployee(): JsonField = keyEmployee + /** * Returns the raw JSON value of [lastName]. * @@ -629,6 +704,22 @@ private constructor( */ @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title + /** + * Returns the raw JSON value of [unionCode]. + * + * Unlike [unionCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_code") @ExcludeMissing fun _unionCode(): JsonField = unionCode + + /** + * Returns the raw JSON value of [unionLocal]. + * + * Unlike [unionLocal], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_local") + @ExcludeMissing + fun _unionLocal(): JsonField = unionLocal + /** * Returns the raw JSON value of [customFields]. * @@ -701,7 +792,9 @@ private constructor( * .endDate() * .firstName() * .flsaStatus() + * .highlyCompensatedEmployee() * .isActive() + * .keyEmployee() * .lastName() * .latestRehireDate() * .location() @@ -709,6 +802,8 @@ private constructor( * .middleName() * .startDate() * .title() + * .unionCode() + * .unionLocal() * ``` */ fun builder() = Builder() @@ -725,7 +820,9 @@ private constructor( private var endDate: JsonField? = null private var firstName: JsonField? = null private var flsaStatus: JsonField? = null + private var highlyCompensatedEmployee: JsonField? = null private var isActive: JsonField? = null + private var keyEmployee: JsonField? = null private var lastName: JsonField? = null private var latestRehireDate: JsonField? = null private var location: JsonField? = null @@ -733,6 +830,8 @@ private constructor( private var middleName: JsonField? = null private var startDate: JsonField? = null private var title: JsonField? = null + private var unionCode: JsonField? = null + private var unionLocal: JsonField? = null private var customFields: JsonField>? = null private var income: JsonField = JsonMissing.of() private var incomeHistory: JsonField>? = null @@ -749,7 +848,9 @@ private constructor( endDate = employmentDataResponseBody.endDate firstName = employmentDataResponseBody.firstName flsaStatus = employmentDataResponseBody.flsaStatus + highlyCompensatedEmployee = employmentDataResponseBody.highlyCompensatedEmployee isActive = employmentDataResponseBody.isActive + keyEmployee = employmentDataResponseBody.keyEmployee lastName = employmentDataResponseBody.lastName latestRehireDate = employmentDataResponseBody.latestRehireDate location = employmentDataResponseBody.location @@ -757,6 +858,8 @@ private constructor( middleName = employmentDataResponseBody.middleName startDate = employmentDataResponseBody.startDate title = employmentDataResponseBody.title + unionCode = employmentDataResponseBody.unionCode + unionLocal = employmentDataResponseBody.unionLocal customFields = employmentDataResponseBody.customFields.map { it.toMutableList() } income = employmentDataResponseBody.income incomeHistory = employmentDataResponseBody.incomeHistory.map { it.toMutableList() } @@ -873,6 +976,32 @@ private constructor( this.flsaStatus = flsaStatus } + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated + * Employee for nondiscrimination testing purposes (ADP/ACP tests). US-only. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean?) = + highlyCompensatedEmployee(JsonField.ofNullable(highlyCompensatedEmployee)) + + /** + * Alias for [Builder.highlyCompensatedEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean) = + highlyCompensatedEmployee(highlyCompensatedEmployee as Boolean?) + + /** + * Sets [Builder.highlyCompensatedEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.highlyCompensatedEmployee] with a well-typed + * [Boolean] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: JsonField) = apply { + this.highlyCompensatedEmployee = highlyCompensatedEmployee + } + /** `true` if the individual an an active employee or contractor at the company. */ fun isActive(isActive: Boolean?) = isActive(JsonField.ofNullable(isActive)) @@ -892,6 +1021,30 @@ private constructor( */ fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** + * IRS flag indicating whether the employee is classified as a Key Employee for + * top-heavy testing purposes. US-only. + */ + fun keyEmployee(keyEmployee: Boolean?) = keyEmployee(JsonField.ofNullable(keyEmployee)) + + /** + * Alias for [Builder.keyEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun keyEmployee(keyEmployee: Boolean) = keyEmployee(keyEmployee as Boolean?) + + /** + * Sets [Builder.keyEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.keyEmployee] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun keyEmployee(keyEmployee: JsonField) = apply { + this.keyEmployee = keyEmployee + } + /** The legal last name of the individual. */ fun lastName(lastName: String?) = lastName(JsonField.ofNullable(lastName)) @@ -976,6 +1129,33 @@ private constructor( */ fun title(title: JsonField) = apply { this.title = title } + /** + * The code identifying the union the employee is a member of, as configured in the + * payroll system. + */ + fun unionCode(unionCode: String?) = unionCode(JsonField.ofNullable(unionCode)) + + /** + * Sets [Builder.unionCode] to an arbitrary JSON value. + * + * You should usually call [Builder.unionCode] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unionCode(unionCode: JsonField) = apply { this.unionCode = unionCode } + + /** The local chapter or local number within the employee's union. */ + fun unionLocal(unionLocal: String?) = unionLocal(JsonField.ofNullable(unionLocal)) + + /** + * Sets [Builder.unionLocal] to an arbitrary JSON value. + * + * You should usually call [Builder.unionLocal] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unionLocal(unionLocal: JsonField) = apply { this.unionLocal = unionLocal } + /** * Custom fields for the individual. These are fields which are defined by the employer * in the system. Custom fields are not currently supported for assisted connections. @@ -1109,7 +1289,9 @@ private constructor( * .endDate() * .firstName() * .flsaStatus() + * .highlyCompensatedEmployee() * .isActive() + * .keyEmployee() * .lastName() * .latestRehireDate() * .location() @@ -1117,6 +1299,8 @@ private constructor( * .middleName() * .startDate() * .title() + * .unionCode() + * .unionLocal() * ``` * * @throws IllegalStateException if any required field is unset. @@ -1131,7 +1315,9 @@ private constructor( checkRequired("endDate", endDate), checkRequired("firstName", firstName), checkRequired("flsaStatus", flsaStatus), + checkRequired("highlyCompensatedEmployee", highlyCompensatedEmployee), checkRequired("isActive", isActive), + checkRequired("keyEmployee", keyEmployee), checkRequired("lastName", lastName), checkRequired("latestRehireDate", latestRehireDate), checkRequired("location", location), @@ -1139,6 +1325,8 @@ private constructor( checkRequired("middleName", middleName), checkRequired("startDate", startDate), checkRequired("title", title), + checkRequired("unionCode", unionCode), + checkRequired("unionLocal", unionLocal), (customFields ?: JsonMissing.of()).map { it.toImmutable() }, income, (incomeHistory ?: JsonMissing.of()).map { it.toImmutable() }, @@ -1172,7 +1360,9 @@ private constructor( endDate() firstName() flsaStatus()?.validate() + highlyCompensatedEmployee() isActive() + keyEmployee() lastName() latestRehireDate() location()?.validate() @@ -1180,6 +1370,8 @@ private constructor( middleName() startDate() title() + unionCode() + unionLocal() customFields()?.forEach { it.validate() } income()?.validate() incomeHistory()?.forEach { it?.validate() } @@ -1211,7 +1403,9 @@ private constructor( (if (endDate.asKnown() == null) 0 else 1) + (if (firstName.asKnown() == null) 0 else 1) + (flsaStatus.asKnown()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown() == null) 0 else 1) + (if (isActive.asKnown() == null) 0 else 1) + + (if (keyEmployee.asKnown() == null) 0 else 1) + (if (lastName.asKnown() == null) 0 else 1) + (if (latestRehireDate.asKnown() == null) 0 else 1) + (location.asKnown()?.validity() ?: 0) + @@ -1219,6 +1413,8 @@ private constructor( (if (middleName.asKnown() == null) 0 else 1) + (if (startDate.asKnown() == null) 0 else 1) + (if (title.asKnown() == null) 0 else 1) + + (if (unionCode.asKnown() == null) 0 else 1) + + (if (unionLocal.asKnown() == null) 0 else 1) + (customFields.asKnown()?.sumOf { it.validity().toInt() } ?: 0) + (income.asKnown()?.validity() ?: 0) + (incomeHistory.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + @@ -2891,7 +3087,9 @@ private constructor( endDate == other.endDate && firstName == other.firstName && flsaStatus == other.flsaStatus && + highlyCompensatedEmployee == other.highlyCompensatedEmployee && isActive == other.isActive && + keyEmployee == other.keyEmployee && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && @@ -2899,6 +3097,8 @@ private constructor( middleName == other.middleName && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && customFields == other.customFields && income == other.income && incomeHistory == other.incomeHistory && @@ -2917,7 +3117,9 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -2925,6 +3127,8 @@ private constructor( middleName, startDate, title, + unionCode, + unionLocal, customFields, income, incomeHistory, @@ -2937,7 +3141,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentDataResponseBody{id=$id, classCode=$classCode, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, flsaStatus=$flsaStatus, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, startDate=$startDate, title=$title, customFields=$customFields, income=$income, incomeHistory=$incomeHistory, sourceId=$sourceId, workId=$workId, additionalProperties=$additionalProperties}" + "EmploymentDataResponseBody{id=$id, classCode=$classCode, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, flsaStatus=$flsaStatus, highlyCompensatedEmployee=$highlyCompensatedEmployee, isActive=$isActive, keyEmployee=$keyEmployee, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, startDate=$startDate, title=$title, unionCode=$unionCode, unionLocal=$unionLocal, customFields=$customFields, income=$income, incomeHistory=$incomeHistory, sourceId=$sourceId, workId=$workId, additionalProperties=$additionalProperties}" } class BatchError diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt index 0d5d5b9ee..f2ba18b1e 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt @@ -40,9 +40,11 @@ private constructor( private val endDate: JsonField, private val firstName: JsonField, private val flsaStatus: JsonField, + private val highlyCompensatedEmployee: JsonField, private val income: JsonField, private val incomeHistory: JsonField>, private val isActive: JsonField, + private val keyEmployee: JsonField, private val lastName: JsonField, private val latestRehireDate: JsonField, private val location: JsonField, @@ -51,6 +53,8 @@ private constructor( private val sourceId: JsonField, private val startDate: JsonField, private val title: JsonField, + private val unionCode: JsonField, + private val unionLocal: JsonField, private val additionalProperties: MutableMap, ) { @@ -75,11 +79,17 @@ private constructor( @JsonProperty("flsa_status") @ExcludeMissing flsaStatus: JsonField = JsonMissing.of(), + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + highlyCompensatedEmployee: JsonField = JsonMissing.of(), @JsonProperty("income") @ExcludeMissing income: JsonField = JsonMissing.of(), @JsonProperty("income_history") @ExcludeMissing incomeHistory: JsonField> = JsonMissing.of(), @JsonProperty("is_active") @ExcludeMissing isActive: JsonField = JsonMissing.of(), + @JsonProperty("key_employee") + @ExcludeMissing + keyEmployee: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), @JsonProperty("latest_rehire_date") @ExcludeMissing @@ -92,6 +102,10 @@ private constructor( @JsonProperty("source_id") @ExcludeMissing sourceId: JsonField = JsonMissing.of(), @JsonProperty("start_date") @ExcludeMissing startDate: JsonField = JsonMissing.of(), @JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(), + @JsonProperty("union_code") @ExcludeMissing unionCode: JsonField = JsonMissing.of(), + @JsonProperty("union_local") + @ExcludeMissing + unionLocal: JsonField = JsonMissing.of(), ) : this( id, classCode, @@ -102,9 +116,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -113,6 +129,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, mutableMapOf(), ) @@ -187,6 +205,16 @@ private constructor( */ fun flsaStatus(): FlsaStatus? = flsaStatus.getNullable("flsa_status") + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee for + * nondiscrimination testing purposes (ADP/ACP tests). US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun highlyCompensatedEmployee(): Boolean? = + highlyCompensatedEmployee.getNullable("highly_compensated_employee") + /** * The employee's income as reported by the provider. This may not always be annualized income, * but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the @@ -213,6 +241,15 @@ private constructor( */ fun isActive(): Boolean? = isActive.getNullable("is_active") + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun keyEmployee(): Boolean? = keyEmployee.getNullable("key_employee") + /** * The legal last name of the individual. * @@ -271,6 +308,23 @@ private constructor( */ fun title(): String? = title.getNullable("title") + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionCode(): String? = unionCode.getNullable("union_code") + + /** + * The local chapter or local number within the employee's union. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionLocal(): String? = unionLocal.getNullable("union_local") + /** * Returns the raw JSON value of [id]. * @@ -345,6 +399,16 @@ private constructor( @ExcludeMissing fun _flsaStatus(): JsonField = flsaStatus + /** + * Returns the raw JSON value of [highlyCompensatedEmployee]. + * + * Unlike [highlyCompensatedEmployee], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + fun _highlyCompensatedEmployee(): JsonField = highlyCompensatedEmployee + /** * Returns the raw JSON value of [income]. * @@ -368,6 +432,15 @@ private constructor( */ @JsonProperty("is_active") @ExcludeMissing fun _isActive(): JsonField = isActive + /** + * Returns the raw JSON value of [keyEmployee]. + * + * Unlike [keyEmployee], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("key_employee") + @ExcludeMissing + fun _keyEmployee(): JsonField = keyEmployee + /** * Returns the raw JSON value of [lastName]. * @@ -427,6 +500,20 @@ private constructor( */ @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title + /** + * Returns the raw JSON value of [unionCode]. + * + * Unlike [unionCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_code") @ExcludeMissing fun _unionCode(): JsonField = unionCode + + /** + * Returns the raw JSON value of [unionLocal]. + * + * Unlike [unionLocal], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_local") @ExcludeMissing fun _unionLocal(): JsonField = unionLocal + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -457,9 +544,11 @@ private constructor( private var endDate: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() private var flsaStatus: JsonField = JsonMissing.of() + private var highlyCompensatedEmployee: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() private var incomeHistory: JsonField>? = null private var isActive: JsonField = JsonMissing.of() + private var keyEmployee: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var latestRehireDate: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() @@ -468,6 +557,8 @@ private constructor( private var sourceId: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() private var title: JsonField = JsonMissing.of() + private var unionCode: JsonField = JsonMissing.of() + private var unionLocal: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(employmentUpdateResponse: EmploymentUpdateResponse) = apply { @@ -480,9 +571,11 @@ private constructor( endDate = employmentUpdateResponse.endDate firstName = employmentUpdateResponse.firstName flsaStatus = employmentUpdateResponse.flsaStatus + highlyCompensatedEmployee = employmentUpdateResponse.highlyCompensatedEmployee income = employmentUpdateResponse.income incomeHistory = employmentUpdateResponse.incomeHistory.map { it.toMutableList() } isActive = employmentUpdateResponse.isActive + keyEmployee = employmentUpdateResponse.keyEmployee lastName = employmentUpdateResponse.lastName latestRehireDate = employmentUpdateResponse.latestRehireDate location = employmentUpdateResponse.location @@ -491,6 +584,8 @@ private constructor( sourceId = employmentUpdateResponse.sourceId startDate = employmentUpdateResponse.startDate title = employmentUpdateResponse.title + unionCode = employmentUpdateResponse.unionCode + unionLocal = employmentUpdateResponse.unionLocal additionalProperties = employmentUpdateResponse.additionalProperties.toMutableMap() } @@ -622,6 +717,32 @@ private constructor( */ fun flsaStatus(flsaStatus: JsonField) = apply { this.flsaStatus = flsaStatus } + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee + * for nondiscrimination testing purposes (ADP/ACP tests). US-only. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean?) = + highlyCompensatedEmployee(JsonField.ofNullable(highlyCompensatedEmployee)) + + /** + * Alias for [Builder.highlyCompensatedEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean) = + highlyCompensatedEmployee(highlyCompensatedEmployee as Boolean?) + + /** + * Sets [Builder.highlyCompensatedEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.highlyCompensatedEmployee] with a well-typed [Boolean] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: JsonField) = apply { + this.highlyCompensatedEmployee = highlyCompensatedEmployee + } + /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what @@ -683,6 +804,28 @@ private constructor( */ fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + */ + fun keyEmployee(keyEmployee: Boolean?) = keyEmployee(JsonField.ofNullable(keyEmployee)) + + /** + * Alias for [Builder.keyEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun keyEmployee(keyEmployee: Boolean) = keyEmployee(keyEmployee as Boolean?) + + /** + * Sets [Builder.keyEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.keyEmployee] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun keyEmployee(keyEmployee: JsonField) = apply { this.keyEmployee = keyEmployee } + /** The legal last name of the individual. */ fun lastName(lastName: String?) = lastName(JsonField.ofNullable(lastName)) @@ -775,6 +918,33 @@ private constructor( */ fun title(title: JsonField) = apply { this.title = title } + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + */ + fun unionCode(unionCode: String?) = unionCode(JsonField.ofNullable(unionCode)) + + /** + * Sets [Builder.unionCode] to an arbitrary JSON value. + * + * You should usually call [Builder.unionCode] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun unionCode(unionCode: JsonField) = apply { this.unionCode = unionCode } + + /** The local chapter or local number within the employee's union. */ + fun unionLocal(unionLocal: String?) = unionLocal(JsonField.ofNullable(unionLocal)) + + /** + * Sets [Builder.unionLocal] to an arbitrary JSON value. + * + * You should usually call [Builder.unionLocal] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun unionLocal(unionLocal: JsonField) = apply { this.unionLocal = unionLocal } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -810,9 +980,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, (incomeHistory ?: JsonMissing.of()).map { it.toImmutable() }, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -821,6 +993,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties.toMutableMap(), ) } @@ -849,9 +1023,11 @@ private constructor( endDate() firstName() flsaStatus()?.validate() + highlyCompensatedEmployee() income()?.validate() incomeHistory()?.forEach { it?.validate() } isActive() + keyEmployee() lastName() latestRehireDate() location()?.validate() @@ -860,6 +1036,8 @@ private constructor( sourceId() startDate() title() + unionCode() + unionLocal() validated = true } @@ -886,9 +1064,11 @@ private constructor( (if (endDate.asKnown() == null) 0 else 1) + (if (firstName.asKnown() == null) 0 else 1) + (flsaStatus.asKnown()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown() == null) 0 else 1) + (income.asKnown()?.validity() ?: 0) + (incomeHistory.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (isActive.asKnown() == null) 0 else 1) + + (if (keyEmployee.asKnown() == null) 0 else 1) + (if (lastName.asKnown() == null) 0 else 1) + (if (latestRehireDate.asKnown() == null) 0 else 1) + (location.asKnown()?.validity() ?: 0) + @@ -896,7 +1076,9 @@ private constructor( (if (middleName.asKnown() == null) 0 else 1) + (if (sourceId.asKnown() == null) 0 else 1) + (if (startDate.asKnown() == null) 0 else 1) + - (if (title.asKnown() == null) 0 else 1) + (if (title.asKnown() == null) 0 else 1) + + (if (unionCode.asKnown() == null) 0 else 1) + + (if (unionLocal.asKnown() == null) 0 else 1) class CustomField @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2477,9 +2659,11 @@ private constructor( endDate == other.endDate && firstName == other.firstName && flsaStatus == other.flsaStatus && + highlyCompensatedEmployee == other.highlyCompensatedEmployee && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && + keyEmployee == other.keyEmployee && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && @@ -2488,6 +2672,8 @@ private constructor( sourceId == other.sourceId && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && additionalProperties == other.additionalProperties } @@ -2502,9 +2688,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -2513,6 +2701,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties, ) } @@ -2520,5 +2710,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentUpdateResponse{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, flsaStatus=$flsaStatus, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" + "EmploymentUpdateResponse{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, flsaStatus=$flsaStatus, highlyCompensatedEmployee=$highlyCompensatedEmployee, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, keyEmployee=$keyEmployee, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, unionCode=$unionCode, unionLocal=$unionLocal, additionalProperties=$additionalProperties}" } diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt index cda484858..1f7ba2176 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt @@ -240,6 +240,7 @@ private constructor( private val firstName: JsonField, private val gender: JsonField, private val lastName: JsonField, + private val maritalStatus: JsonField, private val middleName: JsonField, private val phoneNumbers: JsonField>, private val preferredName: JsonField, @@ -264,6 +265,9 @@ private constructor( @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), + @JsonProperty("marital_status") + @ExcludeMissing + maritalStatus: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @ExcludeMissing middleName: JsonField = JsonMissing.of(), @@ -290,6 +294,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -346,6 +351,15 @@ private constructor( */ fun lastName(): String? = lastName.getNullable("last_name") + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun maritalStatus(): MaritalStatus? = maritalStatus.getNullable("marital_status") + /** * The legal middle name of the individual. * @@ -444,6 +458,16 @@ private constructor( */ @JsonProperty("last_name") @ExcludeMissing fun _lastName(): JsonField = lastName + /** + * Returns the raw JSON value of [maritalStatus]. + * + * Unlike [maritalStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("marital_status") + @ExcludeMissing + fun _maritalStatus(): JsonField = maritalStatus + /** * Returns the raw JSON value of [middleName]. * @@ -529,6 +553,7 @@ private constructor( * .firstName() * .gender() * .lastName() + * .maritalStatus() * .middleName() * .phoneNumbers() * .preferredName() @@ -547,6 +572,7 @@ private constructor( private var firstName: JsonField? = null private var gender: JsonField? = null private var lastName: JsonField? = null + private var maritalStatus: JsonField? = null private var middleName: JsonField? = null private var phoneNumbers: JsonField>? = null private var preferredName: JsonField? = null @@ -563,6 +589,7 @@ private constructor( firstName = individualResponseBody.firstName gender = individualResponseBody.gender lastName = individualResponseBody.lastName + maritalStatus = individualResponseBody.maritalStatus middleName = individualResponseBody.middleName phoneNumbers = individualResponseBody.phoneNumbers.map { it.toMutableList() } preferredName = individualResponseBody.preferredName @@ -644,6 +671,24 @@ private constructor( */ fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + fun maritalStatus(maritalStatus: MaritalStatus?) = + maritalStatus(JsonField.ofNullable(maritalStatus)) + + /** + * Sets [Builder.maritalStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.maritalStatus] with a well-typed [MaritalStatus] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun maritalStatus(maritalStatus: JsonField) = apply { + this.maritalStatus = maritalStatus + } + /** The legal middle name of the individual. */ fun middleName(middleName: String?) = middleName(JsonField.ofNullable(middleName)) @@ -800,6 +845,7 @@ private constructor( * .firstName() * .gender() * .lastName() + * .maritalStatus() * .middleName() * .phoneNumbers() * .preferredName() @@ -816,6 +862,7 @@ private constructor( checkRequired("firstName", firstName), checkRequired("gender", gender), checkRequired("lastName", lastName), + checkRequired("maritalStatus", maritalStatus), checkRequired("middleName", middleName), checkRequired("phoneNumbers", phoneNumbers).map { it.toImmutable() }, checkRequired("preferredName", preferredName), @@ -849,6 +896,7 @@ private constructor( firstName() gender()?.validate() lastName() + maritalStatus()?.validate() middleName() phoneNumbers()?.forEach { it?.validate() } preferredName() @@ -880,6 +928,7 @@ private constructor( (if (firstName.asKnown() == null) 0 else 1) + (gender.asKnown()?.validity() ?: 0) + (if (lastName.asKnown() == null) 0 else 1) + + (maritalStatus.asKnown()?.validity() ?: 0) + (if (middleName.asKnown() == null) 0 else 1) + (phoneNumbers.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown() == null) 0 else 1) + @@ -1214,6 +1263,173 @@ private constructor( override fun toString() = value.toString() } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + class MaritalStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + val SINGLE = of("single") + + val MARRIED = of("married") + + val DIVORCED = of("divorced") + + val WIDOWED = of("widowed") + + val DOMESTIC_PARTNER = of("domestic_partner") + + val UNKNOWN = of("unknown") + + fun of(value: String) = MaritalStatus(JsonField.of(value)) + } + + /** An enum containing [MaritalStatus]'s known values. */ + enum class Known { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + } + + /** + * An enum containing [MaritalStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [MaritalStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + /** + * An enum member indicating that [MaritalStatus] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SINGLE -> Value.SINGLE + MARRIED -> Value.MARRIED + DIVORCED -> Value.DIVORCED + WIDOWED -> Value.WIDOWED + DOMESTIC_PARTNER -> Value.DOMESTIC_PARTNER + UNKNOWN -> Value.UNKNOWN + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SINGLE -> Known.SINGLE + MARRIED -> Known.MARRIED + DIVORCED -> Known.DIVORCED + WIDOWED -> Known.WIDOWED + DOMESTIC_PARTNER -> Known.DOMESTIC_PARTNER + UNKNOWN -> Known.UNKNOWN + else -> throw FinchInvalidDataException("Unknown MaritalStatus: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString() ?: throw FinchInvalidDataException("Value is not a String") + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws FinchInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): MaritalStatus = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: FinchInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MaritalStatus && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + class PhoneNumber @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1907,6 +2123,7 @@ private constructor( firstName == other.firstName && gender == other.gender && lastName == other.lastName && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -1925,6 +2142,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -1939,7 +2157,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndividualResponseBody{id=$id, dob=$dob, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, emails=$emails, encryptedSsn=$encryptedSsn, ssn=$ssn, additionalProperties=$additionalProperties}" + "IndividualResponseBody{id=$id, dob=$dob, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, maritalStatus=$maritalStatus, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, emails=$emails, encryptedSsn=$encryptedSsn, ssn=$ssn, additionalProperties=$additionalProperties}" } class BatchError diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt index 3bf4b0e9e..d5e7ab35e 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt @@ -28,6 +28,7 @@ private constructor( private val firstName: JsonField, private val gender: JsonField, private val lastName: JsonField, + private val maritalStatus: JsonField, private val middleName: JsonField, private val phoneNumbers: JsonField>, private val preferredName: JsonField, @@ -50,6 +51,9 @@ private constructor( @JsonProperty("first_name") @ExcludeMissing firstName: JsonField = JsonMissing.of(), @JsonProperty("gender") @ExcludeMissing gender: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), + @JsonProperty("marital_status") + @ExcludeMissing + maritalStatus: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @ExcludeMissing middleName: JsonField = JsonMissing.of(), @@ -72,6 +76,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -142,6 +147,15 @@ private constructor( */ fun lastName(): String? = lastName.getNullable("last_name") + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun maritalStatus(): MaritalStatus? = maritalStatus.getNullable("marital_status") + /** * The legal middle name of the individual. * @@ -238,6 +252,15 @@ private constructor( */ @JsonProperty("last_name") @ExcludeMissing fun _lastName(): JsonField = lastName + /** + * Returns the raw JSON value of [maritalStatus]. + * + * Unlike [maritalStatus], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("marital_status") + @ExcludeMissing + fun _maritalStatus(): JsonField = maritalStatus + /** * Returns the raw JSON value of [middleName]. * @@ -306,6 +329,7 @@ private constructor( private var firstName: JsonField = JsonMissing.of() private var gender: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() + private var maritalStatus: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField>? = null private var preferredName: JsonField = JsonMissing.of() @@ -322,6 +346,7 @@ private constructor( firstName = individualUpdateResponse.firstName gender = individualUpdateResponse.gender lastName = individualUpdateResponse.lastName + maritalStatus = individualUpdateResponse.maritalStatus middleName = individualUpdateResponse.middleName phoneNumbers = individualUpdateResponse.phoneNumbers.map { it.toMutableList() } preferredName = individualUpdateResponse.preferredName @@ -440,6 +465,24 @@ private constructor( */ fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + fun maritalStatus(maritalStatus: MaritalStatus?) = + maritalStatus(JsonField.ofNullable(maritalStatus)) + + /** + * Sets [Builder.maritalStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.maritalStatus] with a well-typed [MaritalStatus] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun maritalStatus(maritalStatus: JsonField) = apply { + this.maritalStatus = maritalStatus + } + /** The legal middle name of the individual. */ fun middleName(middleName: String?) = middleName(JsonField.ofNullable(middleName)) @@ -553,6 +596,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, (phoneNumbers ?: JsonMissing.of()).map { it.toImmutable() }, preferredName, @@ -585,6 +629,7 @@ private constructor( firstName() gender()?.validate() lastName() + maritalStatus()?.validate() middleName() phoneNumbers()?.forEach { it?.validate() } preferredName() @@ -615,6 +660,7 @@ private constructor( (if (firstName.asKnown() == null) 0 else 1) + (gender.asKnown()?.validity() ?: 0) + (if (lastName.asKnown() == null) 0 else 1) + + (maritalStatus.asKnown()?.validity() ?: 0) + (if (middleName.asKnown() == null) 0 else 1) + (phoneNumbers.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown() == null) 0 else 1) + @@ -1251,6 +1297,171 @@ private constructor( override fun toString() = value.toString() } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + class MaritalStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + val SINGLE = of("single") + + val MARRIED = of("married") + + val DIVORCED = of("divorced") + + val WIDOWED = of("widowed") + + val DOMESTIC_PARTNER = of("domestic_partner") + + val UNKNOWN = of("unknown") + + fun of(value: String) = MaritalStatus(JsonField.of(value)) + } + + /** An enum containing [MaritalStatus]'s known values. */ + enum class Known { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + } + + /** + * An enum containing [MaritalStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [MaritalStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + /** + * An enum member indicating that [MaritalStatus] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SINGLE -> Value.SINGLE + MARRIED -> Value.MARRIED + DIVORCED -> Value.DIVORCED + WIDOWED -> Value.WIDOWED + DOMESTIC_PARTNER -> Value.DOMESTIC_PARTNER + UNKNOWN -> Value.UNKNOWN + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ + fun known(): Known = + when (this) { + SINGLE -> Known.SINGLE + MARRIED -> Known.MARRIED + DIVORCED -> Known.DIVORCED + WIDOWED -> Known.WIDOWED + DOMESTIC_PARTNER -> Known.DOMESTIC_PARTNER + UNKNOWN -> Known.UNKNOWN + else -> throw FinchInvalidDataException("Unknown MaritalStatus: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString() ?: throw FinchInvalidDataException("Value is not a String") + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws FinchInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): MaritalStatus = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: FinchInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MaritalStatus && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + class PhoneNumber @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1577,6 +1788,7 @@ private constructor( firstName == other.firstName && gender == other.gender && lastName == other.lastName && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -1595,6 +1807,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -1607,5 +1820,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndividualUpdateResponse{id=$id, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" + "IndividualUpdateResponse{id=$id, dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, maritalStatus=$maritalStatus, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index 20c3de8f4..92cd61317 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -224,13 +224,16 @@ private constructor( private val firstName: JsonField, private val flsaStatus: JsonField, private val gender: JsonField, + private val highlyCompensatedEmployee: JsonField, private val income: JsonField, private val incomeHistory: JsonField>, private val isActive: JsonField, + private val keyEmployee: JsonField, private val lastName: JsonField, private val latestRehireDate: JsonField, private val location: JsonField, private val manager: JsonField, + private val maritalStatus: JsonField, private val middleName: JsonField, private val phoneNumbers: JsonField>, private val preferredName: JsonField, @@ -239,6 +242,8 @@ private constructor( private val ssn: JsonField, private val startDate: JsonField, private val title: JsonField, + private val unionCode: JsonField, + private val unionLocal: JsonField, private val additionalProperties: MutableMap, ) { @@ -277,6 +282,9 @@ private constructor( @ExcludeMissing flsaStatus: JsonField = JsonMissing.of(), @JsonProperty("gender") @ExcludeMissing gender: JsonField = JsonMissing.of(), + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + highlyCompensatedEmployee: JsonField = JsonMissing.of(), @JsonProperty("income") @ExcludeMissing income: JsonField = JsonMissing.of(), @JsonProperty("income_history") @ExcludeMissing @@ -284,6 +292,9 @@ private constructor( @JsonProperty("is_active") @ExcludeMissing isActive: JsonField = JsonMissing.of(), + @JsonProperty("key_employee") + @ExcludeMissing + keyEmployee: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), @@ -294,6 +305,9 @@ private constructor( @ExcludeMissing location: JsonField = JsonMissing.of(), @JsonProperty("manager") @ExcludeMissing manager: JsonField = JsonMissing.of(), + @JsonProperty("marital_status") + @ExcludeMissing + maritalStatus: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @ExcludeMissing middleName: JsonField = JsonMissing.of(), @@ -314,6 +328,12 @@ private constructor( @ExcludeMissing startDate: JsonField = JsonMissing.of(), @JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(), + @JsonProperty("union_code") + @ExcludeMissing + unionCode: JsonField = JsonMissing.of(), + @JsonProperty("union_local") + @ExcludeMissing + unionLocal: JsonField = JsonMissing.of(), ) : this( classCode, customFields, @@ -328,13 +348,16 @@ private constructor( firstName, flsaStatus, gender, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, manager, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -343,6 +366,8 @@ private constructor( ssn, startDate, title, + unionCode, + unionLocal, mutableMapOf(), ) @@ -448,6 +473,16 @@ private constructor( */ fun gender(): Gender? = gender.getNullable("gender") + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee + * for nondiscrimination testing purposes (ADP/ACP tests). US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun highlyCompensatedEmployee(): Boolean? = + highlyCompensatedEmployee.getNullable("highly_compensated_employee") + /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what @@ -474,6 +509,15 @@ private constructor( */ fun isActive(): Boolean? = isActive.getNullable("is_active") + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun keyEmployee(): Boolean? = keyEmployee.getNullable("key_employee") + /** * The legal last name of the individual. * @@ -502,6 +546,15 @@ private constructor( */ fun manager(): Manager? = manager.getNullable("manager") + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun maritalStatus(): MaritalStatus? = maritalStatus.getNullable("marital_status") + /** * The legal middle name of the individual. * @@ -562,6 +615,23 @@ private constructor( */ fun title(): String? = title.getNullable("title") + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionCode(): String? = unionCode.getNullable("union_code") + + /** + * The local chapter or local number within the employee's union. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionLocal(): String? = unionLocal.getNullable("union_local") + /** * Returns the raw JSON value of [classCode]. * @@ -670,6 +740,16 @@ private constructor( */ @JsonProperty("gender") @ExcludeMissing fun _gender(): JsonField = gender + /** + * Returns the raw JSON value of [highlyCompensatedEmployee]. + * + * Unlike [highlyCompensatedEmployee], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + fun _highlyCompensatedEmployee(): JsonField = highlyCompensatedEmployee + /** * Returns the raw JSON value of [income]. * @@ -694,6 +774,15 @@ private constructor( */ @JsonProperty("is_active") @ExcludeMissing fun _isActive(): JsonField = isActive + /** + * Returns the raw JSON value of [keyEmployee]. + * + * Unlike [keyEmployee], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("key_employee") + @ExcludeMissing + fun _keyEmployee(): JsonField = keyEmployee + /** * Returns the raw JSON value of [lastName]. * @@ -725,6 +814,16 @@ private constructor( */ @JsonProperty("manager") @ExcludeMissing fun _manager(): JsonField = manager + /** + * Returns the raw JSON value of [maritalStatus]. + * + * Unlike [maritalStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("marital_status") + @ExcludeMissing + fun _maritalStatus(): JsonField = maritalStatus + /** * Returns the raw JSON value of [middleName]. * @@ -789,6 +888,22 @@ private constructor( */ @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title + /** + * Returns the raw JSON value of [unionCode]. + * + * Unlike [unionCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_code") @ExcludeMissing fun _unionCode(): JsonField = unionCode + + /** + * Returns the raw JSON value of [unionLocal]. + * + * Unlike [unionLocal], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_local") + @ExcludeMissing + fun _unionLocal(): JsonField = unionLocal + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -825,13 +940,16 @@ private constructor( private var firstName: JsonField = JsonMissing.of() private var flsaStatus: JsonField = JsonMissing.of() private var gender: JsonField = JsonMissing.of() + private var highlyCompensatedEmployee: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() private var incomeHistory: JsonField>? = null private var isActive: JsonField = JsonMissing.of() + private var keyEmployee: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var latestRehireDate: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() private var manager: JsonField = JsonMissing.of() + private var maritalStatus: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField>? = null private var preferredName: JsonField = JsonMissing.of() @@ -840,6 +958,8 @@ private constructor( private var ssn: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() private var title: JsonField = JsonMissing.of() + private var unionCode: JsonField = JsonMissing.of() + private var unionLocal: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(individualOrEmployment: IndividualOrEmployment) = apply { @@ -856,13 +976,16 @@ private constructor( firstName = individualOrEmployment.firstName flsaStatus = individualOrEmployment.flsaStatus gender = individualOrEmployment.gender + highlyCompensatedEmployee = individualOrEmployment.highlyCompensatedEmployee income = individualOrEmployment.income incomeHistory = individualOrEmployment.incomeHistory.map { it.toMutableList() } isActive = individualOrEmployment.isActive + keyEmployee = individualOrEmployment.keyEmployee lastName = individualOrEmployment.lastName latestRehireDate = individualOrEmployment.latestRehireDate location = individualOrEmployment.location manager = individualOrEmployment.manager + maritalStatus = individualOrEmployment.maritalStatus middleName = individualOrEmployment.middleName phoneNumbers = individualOrEmployment.phoneNumbers.map { it.toMutableList() } preferredName = individualOrEmployment.preferredName @@ -871,6 +994,8 @@ private constructor( ssn = individualOrEmployment.ssn startDate = individualOrEmployment.startDate title = individualOrEmployment.title + unionCode = individualOrEmployment.unionCode + unionLocal = individualOrEmployment.unionLocal additionalProperties = individualOrEmployment.additionalProperties.toMutableMap() } @@ -1078,6 +1203,32 @@ private constructor( */ fun gender(gender: JsonField) = apply { this.gender = gender } + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated + * Employee for nondiscrimination testing purposes (ADP/ACP tests). US-only. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean?) = + highlyCompensatedEmployee(JsonField.ofNullable(highlyCompensatedEmployee)) + + /** + * Alias for [Builder.highlyCompensatedEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean) = + highlyCompensatedEmployee(highlyCompensatedEmployee as Boolean?) + + /** + * Sets [Builder.highlyCompensatedEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.highlyCompensatedEmployee] with a well-typed + * [Boolean] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: JsonField) = apply { + this.highlyCompensatedEmployee = highlyCompensatedEmployee + } + /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what @@ -1140,6 +1291,30 @@ private constructor( */ fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** + * IRS flag indicating whether the employee is classified as a Key Employee for + * top-heavy testing purposes. US-only. + */ + fun keyEmployee(keyEmployee: Boolean?) = keyEmployee(JsonField.ofNullable(keyEmployee)) + + /** + * Alias for [Builder.keyEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun keyEmployee(keyEmployee: Boolean) = keyEmployee(keyEmployee as Boolean?) + + /** + * Sets [Builder.keyEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.keyEmployee] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun keyEmployee(keyEmployee: JsonField) = apply { + this.keyEmployee = keyEmployee + } + /** The legal last name of the individual. */ fun lastName(lastName: String?) = lastName(JsonField.ofNullable(lastName)) @@ -1189,6 +1364,24 @@ private constructor( */ fun manager(manager: JsonField) = apply { this.manager = manager } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + fun maritalStatus(maritalStatus: MaritalStatus?) = + maritalStatus(JsonField.ofNullable(maritalStatus)) + + /** + * Sets [Builder.maritalStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.maritalStatus] with a well-typed [MaritalStatus] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun maritalStatus(maritalStatus: JsonField) = apply { + this.maritalStatus = maritalStatus + } + /** The legal middle name of the individual. */ fun middleName(middleName: String?) = middleName(JsonField.ofNullable(middleName)) @@ -1304,6 +1497,33 @@ private constructor( */ fun title(title: JsonField) = apply { this.title = title } + /** + * The code identifying the union the employee is a member of, as configured in the + * payroll system. + */ + fun unionCode(unionCode: String?) = unionCode(JsonField.ofNullable(unionCode)) + + /** + * Sets [Builder.unionCode] to an arbitrary JSON value. + * + * You should usually call [Builder.unionCode] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unionCode(unionCode: JsonField) = apply { this.unionCode = unionCode } + + /** The local chapter or local number within the employee's union. */ + fun unionLocal(unionLocal: String?) = unionLocal(JsonField.ofNullable(unionLocal)) + + /** + * Sets [Builder.unionLocal] to an arbitrary JSON value. + * + * You should usually call [Builder.unionLocal] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unionLocal(unionLocal: JsonField) = apply { this.unionLocal = unionLocal } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1343,13 +1563,16 @@ private constructor( firstName, flsaStatus, gender, + highlyCompensatedEmployee, income, (incomeHistory ?: JsonMissing.of()).map { it.toImmutable() }, isActive, + keyEmployee, lastName, latestRehireDate, location, manager, + maritalStatus, middleName, (phoneNumbers ?: JsonMissing.of()).map { it.toImmutable() }, preferredName, @@ -1358,6 +1581,8 @@ private constructor( ssn, startDate, title, + unionCode, + unionLocal, additionalProperties.toMutableMap(), ) } @@ -1391,13 +1616,16 @@ private constructor( firstName() flsaStatus()?.validate() gender()?.validate() + highlyCompensatedEmployee() income()?.validate() incomeHistory()?.forEach { it?.validate() } isActive() + keyEmployee() lastName() latestRehireDate() location()?.validate() manager()?.validate() + maritalStatus()?.validate() middleName() phoneNumbers()?.forEach { it?.validate() } preferredName() @@ -1406,6 +1634,8 @@ private constructor( ssn() startDate() title() + unionCode() + unionLocal() validated = true } @@ -1437,13 +1667,16 @@ private constructor( (if (firstName.asKnown() == null) 0 else 1) + (flsaStatus.asKnown()?.validity() ?: 0) + (gender.asKnown()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown() == null) 0 else 1) + (income.asKnown()?.validity() ?: 0) + (incomeHistory.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (isActive.asKnown() == null) 0 else 1) + + (if (keyEmployee.asKnown() == null) 0 else 1) + (if (lastName.asKnown() == null) 0 else 1) + (if (latestRehireDate.asKnown() == null) 0 else 1) + (location.asKnown()?.validity() ?: 0) + (manager.asKnown()?.validity() ?: 0) + + (maritalStatus.asKnown()?.validity() ?: 0) + (if (middleName.asKnown() == null) 0 else 1) + (phoneNumbers.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown() == null) 0 else 1) + @@ -1451,7 +1684,9 @@ private constructor( (if (sourceId.asKnown() == null) 0 else 1) + (if (ssn.asKnown() == null) 0 else 1) + (if (startDate.asKnown() == null) 0 else 1) + - (if (title.asKnown() == null) 0 else 1) + (if (title.asKnown() == null) 0 else 1) + + (if (unionCode.asKnown() == null) 0 else 1) + + (if (unionLocal.asKnown() == null) 0 else 1) class CustomField @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3699,6 +3934,173 @@ private constructor( override fun toString() = "Manager{id=$id, additionalProperties=$additionalProperties}" } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + class MaritalStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + val SINGLE = of("single") + + val MARRIED = of("married") + + val DIVORCED = of("divorced") + + val WIDOWED = of("widowed") + + val DOMESTIC_PARTNER = of("domestic_partner") + + val UNKNOWN = of("unknown") + + fun of(value: String) = MaritalStatus(JsonField.of(value)) + } + + /** An enum containing [MaritalStatus]'s known values. */ + enum class Known { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + } + + /** + * An enum containing [MaritalStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [MaritalStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + /** + * An enum member indicating that [MaritalStatus] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SINGLE -> Value.SINGLE + MARRIED -> Value.MARRIED + DIVORCED -> Value.DIVORCED + WIDOWED -> Value.WIDOWED + DOMESTIC_PARTNER -> Value.DOMESTIC_PARTNER + UNKNOWN -> Value.UNKNOWN + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SINGLE -> Known.SINGLE + MARRIED -> Known.MARRIED + DIVORCED -> Known.DIVORCED + WIDOWED -> Known.WIDOWED + DOMESTIC_PARTNER -> Known.DOMESTIC_PARTNER + UNKNOWN -> Known.UNKNOWN + else -> throw FinchInvalidDataException("Unknown MaritalStatus: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString() ?: throw FinchInvalidDataException("Value is not a String") + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws FinchInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): MaritalStatus = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: FinchInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MaritalStatus && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + class PhoneNumber @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -4038,13 +4440,16 @@ private constructor( firstName == other.firstName && flsaStatus == other.flsaStatus && gender == other.gender && + highlyCompensatedEmployee == other.highlyCompensatedEmployee && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && + keyEmployee == other.keyEmployee && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -4053,6 +4458,8 @@ private constructor( ssn == other.ssn && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && additionalProperties == other.additionalProperties } @@ -4071,13 +4478,16 @@ private constructor( firstName, flsaStatus, gender, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, manager, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -4086,6 +4496,8 @@ private constructor( ssn, startDate, title, + unionCode, + unionLocal, additionalProperties, ) } @@ -4093,7 +4505,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndividualOrEmployment{classCode=$classCode, customFields=$customFields, department=$department, dob=$dob, emails=$emails, employment=$employment, employmentStatus=$employmentStatus, encryptedSsn=$encryptedSsn, endDate=$endDate, ethnicity=$ethnicity, firstName=$firstName, flsaStatus=$flsaStatus, gender=$gender, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, sourceId=$sourceId, ssn=$ssn, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" + "IndividualOrEmployment{classCode=$classCode, customFields=$customFields, department=$department, dob=$dob, emails=$emails, employment=$employment, employmentStatus=$employmentStatus, encryptedSsn=$encryptedSsn, endDate=$endDate, ethnicity=$ethnicity, firstName=$firstName, flsaStatus=$flsaStatus, gender=$gender, highlyCompensatedEmployee=$highlyCompensatedEmployee, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, keyEmployee=$keyEmployee, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, maritalStatus=$maritalStatus, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, sourceId=$sourceId, ssn=$ssn, startDate=$startDate, title=$title, unionCode=$unionCode, unionLocal=$unionLocal, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 7ce69ab1c..640397937 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -105,6 +105,15 @@ private constructor( */ fun flsaStatus(): FlsaStatus? = body.flsaStatus() + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee for + * nondiscrimination testing purposes (ADP/ACP tests). US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun highlyCompensatedEmployee(): Boolean? = body.highlyCompensatedEmployee() + /** * The employee's income as reported by the provider. This may not always be annualized income, * but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the @@ -131,6 +140,15 @@ private constructor( */ fun isActive(): Boolean? = body.isActive() + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun keyEmployee(): Boolean? = body.keyEmployee() + /** * The legal last name of the individual. * @@ -189,6 +207,23 @@ private constructor( */ fun title(): String? = body.title() + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionCode(): String? = body.unionCode() + + /** + * The local chapter or local number within the employee's union. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionLocal(): String? = body.unionLocal() + /** * Returns the raw JSON value of [classCode]. * @@ -246,6 +281,14 @@ private constructor( */ fun _flsaStatus(): JsonField = body._flsaStatus() + /** + * Returns the raw JSON value of [highlyCompensatedEmployee]. + * + * Unlike [highlyCompensatedEmployee], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _highlyCompensatedEmployee(): JsonField = body._highlyCompensatedEmployee() + /** * Returns the raw JSON value of [income]. * @@ -267,6 +310,13 @@ private constructor( */ fun _isActive(): JsonField = body._isActive() + /** + * Returns the raw JSON value of [keyEmployee]. + * + * Unlike [keyEmployee], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _keyEmployee(): JsonField = body._keyEmployee() + /** * Returns the raw JSON value of [lastName]. * @@ -324,6 +374,20 @@ private constructor( */ fun _title(): JsonField = body._title() + /** + * Returns the raw JSON value of [unionCode]. + * + * Unlike [unionCode], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _unionCode(): JsonField = body._unionCode() + + /** + * Returns the raw JSON value of [unionLocal]. + * + * Unlike [unionLocal], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _unionLocal(): JsonField = body._unionLocal() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -490,6 +554,33 @@ private constructor( */ fun flsaStatus(flsaStatus: JsonField) = apply { body.flsaStatus(flsaStatus) } + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee + * for nondiscrimination testing purposes (ADP/ACP tests). US-only. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean?) = apply { + body.highlyCompensatedEmployee(highlyCompensatedEmployee) + } + + /** + * Alias for [Builder.highlyCompensatedEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean) = + highlyCompensatedEmployee(highlyCompensatedEmployee as Boolean?) + + /** + * Sets [Builder.highlyCompensatedEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.highlyCompensatedEmployee] with a well-typed [Boolean] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: JsonField) = apply { + body.highlyCompensatedEmployee(highlyCompensatedEmployee) + } + /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what @@ -547,6 +638,28 @@ private constructor( */ fun isActive(isActive: JsonField) = apply { body.isActive(isActive) } + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + */ + fun keyEmployee(keyEmployee: Boolean?) = apply { body.keyEmployee(keyEmployee) } + + /** + * Alias for [Builder.keyEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun keyEmployee(keyEmployee: Boolean) = keyEmployee(keyEmployee as Boolean?) + + /** + * Sets [Builder.keyEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.keyEmployee] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun keyEmployee(keyEmployee: JsonField) = apply { body.keyEmployee(keyEmployee) } + /** The legal last name of the individual. */ fun lastName(lastName: String?) = apply { body.lastName(lastName) } @@ -640,6 +753,33 @@ private constructor( */ fun title(title: JsonField) = apply { body.title(title) } + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + */ + fun unionCode(unionCode: String?) = apply { body.unionCode(unionCode) } + + /** + * Sets [Builder.unionCode] to an arbitrary JSON value. + * + * You should usually call [Builder.unionCode] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun unionCode(unionCode: JsonField) = apply { body.unionCode(unionCode) } + + /** The local chapter or local number within the employee's union. */ + fun unionLocal(unionLocal: String?) = apply { body.unionLocal(unionLocal) } + + /** + * Sets [Builder.unionLocal] to an arbitrary JSON value. + * + * You should usually call [Builder.unionLocal] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun unionLocal(unionLocal: JsonField) = apply { body.unionLocal(unionLocal) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -794,9 +934,11 @@ private constructor( private val endDate: JsonField, private val firstName: JsonField, private val flsaStatus: JsonField, + private val highlyCompensatedEmployee: JsonField, private val income: JsonField, private val incomeHistory: JsonField>, private val isActive: JsonField, + private val keyEmployee: JsonField, private val lastName: JsonField, private val latestRehireDate: JsonField, private val location: JsonField, @@ -805,6 +947,8 @@ private constructor( private val sourceId: JsonField, private val startDate: JsonField, private val title: JsonField, + private val unionCode: JsonField, + private val unionLocal: JsonField, private val additionalProperties: MutableMap, ) { @@ -832,6 +976,9 @@ private constructor( @JsonProperty("flsa_status") @ExcludeMissing flsaStatus: JsonField = JsonMissing.of(), + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + highlyCompensatedEmployee: JsonField = JsonMissing.of(), @JsonProperty("income") @ExcludeMissing income: JsonField = JsonMissing.of(), @JsonProperty("income_history") @ExcludeMissing @@ -839,6 +986,9 @@ private constructor( @JsonProperty("is_active") @ExcludeMissing isActive: JsonField = JsonMissing.of(), + @JsonProperty("key_employee") + @ExcludeMissing + keyEmployee: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), @@ -859,6 +1009,12 @@ private constructor( @ExcludeMissing startDate: JsonField = JsonMissing.of(), @JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(), + @JsonProperty("union_code") + @ExcludeMissing + unionCode: JsonField = JsonMissing.of(), + @JsonProperty("union_local") + @ExcludeMissing + unionLocal: JsonField = JsonMissing.of(), ) : this( classCode, customFields, @@ -868,9 +1024,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -879,6 +1037,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, mutableMapOf(), ) @@ -946,6 +1106,16 @@ private constructor( */ fun flsaStatus(): FlsaStatus? = flsaStatus.getNullable("flsa_status") + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated Employee + * for nondiscrimination testing purposes (ADP/ACP tests). US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun highlyCompensatedEmployee(): Boolean? = + highlyCompensatedEmployee.getNullable("highly_compensated_employee") + /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what @@ -972,6 +1142,15 @@ private constructor( */ fun isActive(): Boolean? = isActive.getNullable("is_active") + /** + * IRS flag indicating whether the employee is classified as a Key Employee for top-heavy + * testing purposes. US-only. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun keyEmployee(): Boolean? = keyEmployee.getNullable("key_employee") + /** * The legal last name of the individual. * @@ -1030,6 +1209,23 @@ private constructor( */ fun title(): String? = title.getNullable("title") + /** + * The code identifying the union the employee is a member of, as configured in the payroll + * system. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionCode(): String? = unionCode.getNullable("union_code") + + /** + * The local chapter or local number within the employee's union. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unionLocal(): String? = unionLocal.getNullable("union_local") + /** * Returns the raw JSON value of [classCode]. * @@ -1098,6 +1294,16 @@ private constructor( @ExcludeMissing fun _flsaStatus(): JsonField = flsaStatus + /** + * Returns the raw JSON value of [highlyCompensatedEmployee]. + * + * Unlike [highlyCompensatedEmployee], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("highly_compensated_employee") + @ExcludeMissing + fun _highlyCompensatedEmployee(): JsonField = highlyCompensatedEmployee + /** * Returns the raw JSON value of [income]. * @@ -1122,6 +1328,15 @@ private constructor( */ @JsonProperty("is_active") @ExcludeMissing fun _isActive(): JsonField = isActive + /** + * Returns the raw JSON value of [keyEmployee]. + * + * Unlike [keyEmployee], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("key_employee") + @ExcludeMissing + fun _keyEmployee(): JsonField = keyEmployee + /** * Returns the raw JSON value of [lastName]. * @@ -1183,6 +1398,22 @@ private constructor( */ @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title + /** + * Returns the raw JSON value of [unionCode]. + * + * Unlike [unionCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_code") @ExcludeMissing fun _unionCode(): JsonField = unionCode + + /** + * Returns the raw JSON value of [unionLocal]. + * + * Unlike [unionLocal], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("union_local") + @ExcludeMissing + fun _unionLocal(): JsonField = unionLocal + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1212,9 +1443,11 @@ private constructor( private var endDate: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() private var flsaStatus: JsonField = JsonMissing.of() + private var highlyCompensatedEmployee: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() private var incomeHistory: JsonField>? = null private var isActive: JsonField = JsonMissing.of() + private var keyEmployee: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var latestRehireDate: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() @@ -1223,6 +1456,8 @@ private constructor( private var sourceId: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() private var title: JsonField = JsonMissing.of() + private var unionCode: JsonField = JsonMissing.of() + private var unionLocal: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(employmentWithoutId: EmploymentWithoutId) = apply { @@ -1234,9 +1469,11 @@ private constructor( endDate = employmentWithoutId.endDate firstName = employmentWithoutId.firstName flsaStatus = employmentWithoutId.flsaStatus + highlyCompensatedEmployee = employmentWithoutId.highlyCompensatedEmployee income = employmentWithoutId.income incomeHistory = employmentWithoutId.incomeHistory.map { it.toMutableList() } isActive = employmentWithoutId.isActive + keyEmployee = employmentWithoutId.keyEmployee lastName = employmentWithoutId.lastName latestRehireDate = employmentWithoutId.latestRehireDate location = employmentWithoutId.location @@ -1245,6 +1482,8 @@ private constructor( sourceId = employmentWithoutId.sourceId startDate = employmentWithoutId.startDate title = employmentWithoutId.title + unionCode = employmentWithoutId.unionCode + unionLocal = employmentWithoutId.unionLocal additionalProperties = employmentWithoutId.additionalProperties.toMutableMap() } @@ -1373,6 +1612,32 @@ private constructor( this.flsaStatus = flsaStatus } + /** + * IRS flag indicating whether the employee is classified as a Highly Compensated + * Employee for nondiscrimination testing purposes (ADP/ACP tests). US-only. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean?) = + highlyCompensatedEmployee(JsonField.ofNullable(highlyCompensatedEmployee)) + + /** + * Alias for [Builder.highlyCompensatedEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Boolean) = + highlyCompensatedEmployee(highlyCompensatedEmployee as Boolean?) + + /** + * Sets [Builder.highlyCompensatedEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.highlyCompensatedEmployee] with a well-typed + * [Boolean] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: JsonField) = apply { + this.highlyCompensatedEmployee = highlyCompensatedEmployee + } + /** * The employee's income as reported by the provider. This may not always be annualized * income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what @@ -1435,6 +1700,30 @@ private constructor( */ fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** + * IRS flag indicating whether the employee is classified as a Key Employee for + * top-heavy testing purposes. US-only. + */ + fun keyEmployee(keyEmployee: Boolean?) = keyEmployee(JsonField.ofNullable(keyEmployee)) + + /** + * Alias for [Builder.keyEmployee]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun keyEmployee(keyEmployee: Boolean) = keyEmployee(keyEmployee as Boolean?) + + /** + * Sets [Builder.keyEmployee] to an arbitrary JSON value. + * + * You should usually call [Builder.keyEmployee] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun keyEmployee(keyEmployee: JsonField) = apply { + this.keyEmployee = keyEmployee + } + /** The legal last name of the individual. */ fun lastName(lastName: String?) = lastName(JsonField.ofNullable(lastName)) @@ -1531,6 +1820,33 @@ private constructor( */ fun title(title: JsonField) = apply { this.title = title } + /** + * The code identifying the union the employee is a member of, as configured in the + * payroll system. + */ + fun unionCode(unionCode: String?) = unionCode(JsonField.ofNullable(unionCode)) + + /** + * Sets [Builder.unionCode] to an arbitrary JSON value. + * + * You should usually call [Builder.unionCode] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unionCode(unionCode: JsonField) = apply { this.unionCode = unionCode } + + /** The local chapter or local number within the employee's union. */ + fun unionLocal(unionLocal: String?) = unionLocal(JsonField.ofNullable(unionLocal)) + + /** + * Sets [Builder.unionLocal] to an arbitrary JSON value. + * + * You should usually call [Builder.unionLocal] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unionLocal(unionLocal: JsonField) = apply { this.unionLocal = unionLocal } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1565,9 +1881,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, (incomeHistory ?: JsonMissing.of()).map { it.toImmutable() }, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -1576,6 +1894,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties.toMutableMap(), ) } @@ -1604,9 +1924,11 @@ private constructor( endDate() firstName() flsaStatus()?.validate() + highlyCompensatedEmployee() income()?.validate() incomeHistory()?.forEach { it?.validate() } isActive() + keyEmployee() lastName() latestRehireDate() location()?.validate() @@ -1615,6 +1937,8 @@ private constructor( sourceId() startDate() title() + unionCode() + unionLocal() validated = true } @@ -1641,9 +1965,11 @@ private constructor( (if (endDate.asKnown() == null) 0 else 1) + (if (firstName.asKnown() == null) 0 else 1) + (flsaStatus.asKnown()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown() == null) 0 else 1) + (income.asKnown()?.validity() ?: 0) + (incomeHistory.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (isActive.asKnown() == null) 0 else 1) + + (if (keyEmployee.asKnown() == null) 0 else 1) + (if (lastName.asKnown() == null) 0 else 1) + (if (latestRehireDate.asKnown() == null) 0 else 1) + (location.asKnown()?.validity() ?: 0) + @@ -1651,7 +1977,9 @@ private constructor( (if (middleName.asKnown() == null) 0 else 1) + (if (sourceId.asKnown() == null) 0 else 1) + (if (startDate.asKnown() == null) 0 else 1) + - (if (title.asKnown() == null) 0 else 1) + (if (title.asKnown() == null) 0 else 1) + + (if (unionCode.asKnown() == null) 0 else 1) + + (if (unionLocal.asKnown() == null) 0 else 1) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1667,9 +1995,11 @@ private constructor( endDate == other.endDate && firstName == other.firstName && flsaStatus == other.flsaStatus && + highlyCompensatedEmployee == other.highlyCompensatedEmployee && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && + keyEmployee == other.keyEmployee && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && @@ -1678,6 +2008,8 @@ private constructor( sourceId == other.sourceId && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && additionalProperties == other.additionalProperties } @@ -1691,9 +2023,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -1702,6 +2036,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties, ) } @@ -1709,7 +2045,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentWithoutId{classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, flsaStatus=$flsaStatus, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" + "EmploymentWithoutId{classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, flsaStatus=$flsaStatus, highlyCompensatedEmployee=$highlyCompensatedEmployee, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, keyEmployee=$keyEmployee, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, unionCode=$unionCode, unionLocal=$unionLocal, additionalProperties=$additionalProperties}" } class CustomField diff --git a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 51686ff3a..07bdb37b2 100644 --- a/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt +++ b/finch-kotlin-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt @@ -85,6 +85,15 @@ private constructor( */ fun lastName(): String? = body.lastName() + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun maritalStatus(): MaritalStatus? = body.maritalStatus() + /** * The legal middle name of the individual. * @@ -172,6 +181,13 @@ private constructor( */ fun _lastName(): JsonField = body._lastName() + /** + * Returns the raw JSON value of [maritalStatus]. + * + * Unlike [maritalStatus], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _maritalStatus(): JsonField = body._maritalStatus() + /** * Returns the raw JSON value of [middleName]. * @@ -351,6 +367,25 @@ private constructor( */ fun lastName(lastName: JsonField) = apply { body.lastName(lastName) } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + fun maritalStatus(maritalStatus: MaritalStatus?) = apply { + body.maritalStatus(maritalStatus) + } + + /** + * Sets [Builder.maritalStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.maritalStatus] with a well-typed [MaritalStatus] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun maritalStatus(maritalStatus: JsonField) = apply { + body.maritalStatus(maritalStatus) + } + /** The legal middle name of the individual. */ fun middleName(middleName: String?) = apply { body.middleName(middleName) } @@ -578,6 +613,7 @@ private constructor( private val firstName: JsonField, private val gender: JsonField, private val lastName: JsonField, + private val maritalStatus: JsonField, private val middleName: JsonField, private val phoneNumbers: JsonField>, private val preferredName: JsonField, @@ -605,6 +641,9 @@ private constructor( @JsonProperty("last_name") @ExcludeMissing lastName: JsonField = JsonMissing.of(), + @JsonProperty("marital_status") + @ExcludeMissing + maritalStatus: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @ExcludeMissing middleName: JsonField = JsonMissing.of(), @@ -626,6 +665,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -688,6 +728,15 @@ private constructor( */ fun lastName(): String? = lastName.getNullable("last_name") + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + * + * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun maritalStatus(): MaritalStatus? = maritalStatus.getNullable("marital_status") + /** * The legal middle name of the individual. * @@ -780,6 +829,16 @@ private constructor( */ @JsonProperty("last_name") @ExcludeMissing fun _lastName(): JsonField = lastName + /** + * Returns the raw JSON value of [maritalStatus]. + * + * Unlike [maritalStatus], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("marital_status") + @ExcludeMissing + fun _maritalStatus(): JsonField = maritalStatus + /** * Returns the raw JSON value of [middleName]. * @@ -851,6 +910,7 @@ private constructor( private var firstName: JsonField = JsonMissing.of() private var gender: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() + private var maritalStatus: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var phoneNumbers: JsonField>? = null private var preferredName: JsonField = JsonMissing.of() @@ -866,6 +926,7 @@ private constructor( firstName = individualWithoutId.firstName gender = individualWithoutId.gender lastName = individualWithoutId.lastName + maritalStatus = individualWithoutId.maritalStatus middleName = individualWithoutId.middleName phoneNumbers = individualWithoutId.phoneNumbers.map { it.toMutableList() } preferredName = individualWithoutId.preferredName @@ -977,6 +1038,24 @@ private constructor( */ fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + fun maritalStatus(maritalStatus: MaritalStatus?) = + maritalStatus(JsonField.ofNullable(maritalStatus)) + + /** + * Sets [Builder.maritalStatus] to an arbitrary JSON value. + * + * You should usually call [Builder.maritalStatus] with a well-typed [MaritalStatus] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun maritalStatus(maritalStatus: JsonField) = apply { + this.maritalStatus = maritalStatus + } + /** The legal middle name of the individual. */ fun middleName(middleName: String?) = middleName(JsonField.ofNullable(middleName)) @@ -1090,6 +1169,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, (phoneNumbers ?: JsonMissing.of()).map { it.toImmutable() }, preferredName, @@ -1122,6 +1202,7 @@ private constructor( firstName() gender()?.validate() lastName() + maritalStatus()?.validate() middleName() phoneNumbers()?.forEach { it?.validate() } preferredName() @@ -1152,6 +1233,7 @@ private constructor( (if (firstName.asKnown() == null) 0 else 1) + (gender.asKnown()?.validity() ?: 0) + (if (lastName.asKnown() == null) 0 else 1) + + (maritalStatus.asKnown()?.validity() ?: 0) + (if (middleName.asKnown() == null) 0 else 1) + (phoneNumbers.asKnown()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown() == null) 0 else 1) + @@ -1171,6 +1253,7 @@ private constructor( firstName == other.firstName && gender == other.gender && lastName == other.lastName && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -1188,6 +1271,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -1200,7 +1284,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndividualWithoutId{dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" + "IndividualWithoutId{dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, maritalStatus=$maritalStatus, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } class Email @@ -1833,6 +1917,171 @@ private constructor( override fun toString() = value.toString() } + /** + * The employee's marital status, used for beneficiary designation and spousal consent + * workflows. + */ + class MaritalStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + val SINGLE = of("single") + + val MARRIED = of("married") + + val DIVORCED = of("divorced") + + val WIDOWED = of("widowed") + + val DOMESTIC_PARTNER = of("domestic_partner") + + val UNKNOWN = of("unknown") + + fun of(value: String) = MaritalStatus(JsonField.of(value)) + } + + /** An enum containing [MaritalStatus]'s known values. */ + enum class Known { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + } + + /** + * An enum containing [MaritalStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [MaritalStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SINGLE, + MARRIED, + DIVORCED, + WIDOWED, + DOMESTIC_PARTNER, + UNKNOWN, + /** + * An enum member indicating that [MaritalStatus] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SINGLE -> Value.SINGLE + MARRIED -> Value.MARRIED + DIVORCED -> Value.DIVORCED + WIDOWED -> Value.WIDOWED + DOMESTIC_PARTNER -> Value.DOMESTIC_PARTNER + UNKNOWN -> Value.UNKNOWN + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws FinchInvalidDataException if this class instance's value is a not a known member. + */ + fun known(): Known = + when (this) { + SINGLE -> Known.SINGLE + MARRIED -> Known.MARRIED + DIVORCED -> Known.DIVORCED + WIDOWED -> Known.WIDOWED + DOMESTIC_PARTNER -> Known.DOMESTIC_PARTNER + UNKNOWN -> Known.UNKNOWN + else -> throw FinchInvalidDataException("Unknown MaritalStatus: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString() ?: throw FinchInvalidDataException("Value is not a String") + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws FinchInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): MaritalStatus = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: FinchInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MaritalStatus && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + class PhoneNumber @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt index 5d61fcf48..8bf8ae3a6 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt @@ -41,7 +41,9 @@ internal class EmploymentDataResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -64,6 +66,8 @@ internal class EmploymentDataResponseTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") @@ -123,7 +127,9 @@ internal class EmploymentDataResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -146,6 +152,8 @@ internal class EmploymentDataResponseTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") @@ -210,7 +218,9 @@ internal class EmploymentDataResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -233,6 +243,8 @@ internal class EmploymentDataResponseTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt index 3aa44aa62..40102d90e 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt @@ -38,7 +38,9 @@ internal class EmploymentDataTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -61,6 +63,8 @@ internal class EmploymentDataTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") @@ -123,7 +127,9 @@ internal class EmploymentDataTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -146,6 +152,8 @@ internal class EmploymentDataTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt index 443be6f5d..9c85e56a7 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt @@ -33,6 +33,7 @@ internal class EmploymentUpdateResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentUpdateResponse.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -50,6 +51,7 @@ internal class EmploymentUpdateResponseTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -73,6 +75,8 @@ internal class EmploymentUpdateResponseTest { .sourceId("source_id") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() assertThat(employmentUpdateResponse.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -96,6 +100,7 @@ internal class EmploymentUpdateResponseTest { assertThat(employmentUpdateResponse.firstName()).isEqualTo("first_name") assertThat(employmentUpdateResponse.flsaStatus()) .isEqualTo(EmploymentUpdateResponse.FlsaStatus.EXEMPT) + assertThat(employmentUpdateResponse.highlyCompensatedEmployee()).isEqualTo(true) assertThat(employmentUpdateResponse.income()) .isEqualTo( Income.builder() @@ -115,6 +120,7 @@ internal class EmploymentUpdateResponseTest { .build() ) assertThat(employmentUpdateResponse.isActive()).isEqualTo(true) + assertThat(employmentUpdateResponse.keyEmployee()).isEqualTo(true) assertThat(employmentUpdateResponse.lastName()).isEqualTo("last_name") assertThat(employmentUpdateResponse.latestRehireDate()).isEqualTo("latest_rehire_date") assertThat(employmentUpdateResponse.location()) @@ -140,6 +146,8 @@ internal class EmploymentUpdateResponseTest { assertThat(employmentUpdateResponse.sourceId()).isEqualTo("source_id") assertThat(employmentUpdateResponse.startDate()).isEqualTo("start_date") assertThat(employmentUpdateResponse.title()).isEqualTo("title") + assertThat(employmentUpdateResponse.unionCode()).isEqualTo("union_code") + assertThat(employmentUpdateResponse.unionLocal()).isEqualTo("union_local") } @Test @@ -166,6 +174,7 @@ internal class EmploymentUpdateResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentUpdateResponse.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -183,6 +192,7 @@ internal class EmploymentUpdateResponseTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -206,6 +216,8 @@ internal class EmploymentUpdateResponseTest { .sourceId("source_id") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() val roundtrippedEmploymentUpdateResponse = diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt index ca53f56f7..1dbfd6031 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt @@ -48,7 +48,9 @@ internal class HrisEmploymentRetrieveManyPageResponseTest { .flsaStatus( EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT ) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -71,6 +73,8 @@ internal class HrisEmploymentRetrieveManyPageResponseTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") @@ -133,7 +137,9 @@ internal class HrisEmploymentRetrieveManyPageResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -156,6 +162,8 @@ internal class HrisEmploymentRetrieveManyPageResponseTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") @@ -227,7 +235,9 @@ internal class HrisEmploymentRetrieveManyPageResponseTest { .flsaStatus( EmploymentData.EmploymentDataResponseBody.FlsaStatus.EXEMPT ) + .highlyCompensatedEmployee(true) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -250,6 +260,8 @@ internal class HrisEmploymentRetrieveManyPageResponseTest { .middleName("middle_name") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .addCustomField( EmploymentData.EmploymentDataResponseBody.CustomField.builder() .name("name") diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt index 8127fd804..e791fd07c 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt @@ -23,6 +23,9 @@ internal class HrisIndividualRetrieveManyPageResponseTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus( + Individual.IndividualResponseBody.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() @@ -72,6 +75,7 @@ internal class HrisIndividualRetrieveManyPageResponseTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() @@ -123,6 +127,9 @@ internal class HrisIndividualRetrieveManyPageResponseTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus( + Individual.IndividualResponseBody.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt index bc0698bd2..542518b2a 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt @@ -21,6 +21,7 @@ internal class IndividualResponseTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() @@ -65,6 +66,7 @@ internal class IndividualResponseTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() @@ -113,6 +115,7 @@ internal class IndividualResponseTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt index 62d1c5d06..63f6b8360 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt @@ -24,6 +24,7 @@ internal class IndividualTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() @@ -72,6 +73,7 @@ internal class IndividualTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder() diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt index 523e8dbc0..25965024b 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt @@ -26,6 +26,7 @@ internal class IndividualUpdateResponseTest { .firstName("first_name") .gender(IndividualUpdateResponse.Gender.FEMALE) .lastName("last_name") + .maritalStatus(IndividualUpdateResponse.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( IndividualUpdateResponse.PhoneNumber.builder() @@ -65,6 +66,8 @@ internal class IndividualUpdateResponseTest { assertThat(individualUpdateResponse.gender()) .isEqualTo(IndividualUpdateResponse.Gender.FEMALE) assertThat(individualUpdateResponse.lastName()).isEqualTo("last_name") + assertThat(individualUpdateResponse.maritalStatus()) + .isEqualTo(IndividualUpdateResponse.MaritalStatus.SINGLE) assertThat(individualUpdateResponse.middleName()).isEqualTo("middle_name") assertThat(individualUpdateResponse.phoneNumbers()) .containsExactly( @@ -108,6 +111,7 @@ internal class IndividualUpdateResponseTest { .firstName("first_name") .gender(IndividualUpdateResponse.Gender.FEMALE) .lastName("last_name") + .maritalStatus(IndividualUpdateResponse.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( IndividualUpdateResponse.PhoneNumber.builder() diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt index c92e28c3d..ac7897421 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt @@ -58,6 +58,7 @@ internal class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -75,6 +76,7 @@ internal class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -94,6 +96,9 @@ internal class SandboxDirectoryCreateParamsTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber.builder() @@ -121,6 +126,8 @@ internal class SandboxDirectoryCreateParamsTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) .build() @@ -183,6 +190,7 @@ internal class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -200,6 +208,7 @@ internal class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -219,6 +228,9 @@ internal class SandboxDirectoryCreateParamsTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber @@ -248,6 +260,8 @@ internal class SandboxDirectoryCreateParamsTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) .build() @@ -302,6 +316,7 @@ internal class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -319,6 +334,7 @@ internal class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -338,6 +354,9 @@ internal class SandboxDirectoryCreateParamsTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber.builder() @@ -365,6 +384,8 @@ internal class SandboxDirectoryCreateParamsTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) } diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt index 6bf03c354..d9d323d10 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt @@ -30,6 +30,7 @@ internal class SandboxEmploymentUpdateParamsTest { .endDate("end_date") .firstName("first_name") .flsaStatus(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -47,6 +48,7 @@ internal class SandboxEmploymentUpdateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -70,6 +72,8 @@ internal class SandboxEmploymentUpdateParamsTest { .sourceId("source_id") .startDate("3/4/2020") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() } @@ -105,6 +109,7 @@ internal class SandboxEmploymentUpdateParamsTest { .endDate("end_date") .firstName("first_name") .flsaStatus(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -122,6 +127,7 @@ internal class SandboxEmploymentUpdateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -145,6 +151,8 @@ internal class SandboxEmploymentUpdateParamsTest { .sourceId("source_id") .startDate("3/4/2020") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() val body = params._body() @@ -171,6 +179,7 @@ internal class SandboxEmploymentUpdateParamsTest { assertThat(body.endDate()).isEqualTo("end_date") assertThat(body.firstName()).isEqualTo("first_name") assertThat(body.flsaStatus()).isEqualTo(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + assertThat(body.highlyCompensatedEmployee()).isEqualTo(true) assertThat(body.income()) .isEqualTo( Income.builder() @@ -190,6 +199,7 @@ internal class SandboxEmploymentUpdateParamsTest { .build() ) assertThat(body.isActive()).isEqualTo(true) + assertThat(body.keyEmployee()).isEqualTo(true) assertThat(body.lastName()).isEqualTo("last_name") assertThat(body.latestRehireDate()).isEqualTo("latest_rehire_date") assertThat(body.location()) @@ -215,6 +225,8 @@ internal class SandboxEmploymentUpdateParamsTest { assertThat(body.sourceId()).isEqualTo("source_id") assertThat(body.startDate()).isEqualTo("3/4/2020") assertThat(body.title()).isEqualTo("title") + assertThat(body.unionCode()).isEqualTo("union_code") + assertThat(body.unionLocal()).isEqualTo("union_local") } @Test diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt index b5f9ae772..8b19082f8 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt @@ -23,6 +23,7 @@ internal class SandboxIndividualUpdateParamsTest { .firstName("first_name") .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") + .maritalStatus(SandboxIndividualUpdateParams.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( SandboxIndividualUpdateParams.PhoneNumber.builder() @@ -73,6 +74,7 @@ internal class SandboxIndividualUpdateParamsTest { .firstName("first_name") .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") + .maritalStatus(SandboxIndividualUpdateParams.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( SandboxIndividualUpdateParams.PhoneNumber.builder() @@ -111,6 +113,8 @@ internal class SandboxIndividualUpdateParamsTest { assertThat(body.firstName()).isEqualTo("first_name") assertThat(body.gender()).isEqualTo(SandboxIndividualUpdateParams.Gender.FEMALE) assertThat(body.lastName()).isEqualTo("last_name") + assertThat(body.maritalStatus()) + .isEqualTo(SandboxIndividualUpdateParams.MaritalStatus.SINGLE) assertThat(body.middleName()).isEqualTo("middle_name") assertThat(body.phoneNumbers()) .containsExactly( diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt index 4811e8905..de4a525c7 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt @@ -78,6 +78,7 @@ internal class DirectoryServiceAsyncTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -95,6 +96,7 @@ internal class DirectoryServiceAsyncTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -114,6 +116,9 @@ internal class DirectoryServiceAsyncTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber @@ -143,6 +148,8 @@ internal class DirectoryServiceAsyncTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) ) diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt index 62a93160f..39d287cc6 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt @@ -47,6 +47,7 @@ internal class EmploymentServiceAsyncTest { .endDate("end_date") .firstName("first_name") .flsaStatus(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -64,6 +65,7 @@ internal class EmploymentServiceAsyncTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -87,6 +89,8 @@ internal class EmploymentServiceAsyncTest { .sourceId("source_id") .startDate("3/4/2020") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt index 5d02241e8..e2410de33 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt @@ -37,6 +37,7 @@ internal class IndividualServiceAsyncTest { .firstName("first_name") .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") + .maritalStatus(SandboxIndividualUpdateParams.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( SandboxIndividualUpdateParams.PhoneNumber.builder() diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt index 43c9a960f..e6316cb24 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt @@ -78,6 +78,7 @@ internal class DirectoryServiceTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -95,6 +96,7 @@ internal class DirectoryServiceTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -114,6 +116,9 @@ internal class DirectoryServiceTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber @@ -143,6 +148,8 @@ internal class DirectoryServiceTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) ) diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt index 9890da4f5..e80d5a5c8 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt @@ -47,6 +47,7 @@ internal class EmploymentServiceTest { .endDate("end_date") .firstName("first_name") .flsaStatus(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -64,6 +65,7 @@ internal class EmploymentServiceTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -87,6 +89,8 @@ internal class EmploymentServiceTest { .sourceId("source_id") .startDate("3/4/2020") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) diff --git a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt index 2c097a2eb..5b3c22db8 100644 --- a/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt +++ b/finch-kotlin-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt @@ -37,6 +37,7 @@ internal class IndividualServiceTest { .firstName("first_name") .gender(SandboxIndividualUpdateParams.Gender.FEMALE) .lastName("last_name") + .maritalStatus(SandboxIndividualUpdateParams.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( SandboxIndividualUpdateParams.PhoneNumber.builder() diff --git a/finch-kotlin-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt b/finch-kotlin-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt index ca55ce198..8fba24ba4 100644 --- a/finch-kotlin-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt +++ b/finch-kotlin-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt @@ -101,6 +101,7 @@ internal class ProGuardCompatibilityTest { .firstName("first_name") .gender(Individual.IndividualResponseBody.Gender.FEMALE) .lastName("last_name") + .maritalStatus(Individual.IndividualResponseBody.MaritalStatus.SINGLE) .middleName("middle_name") .addPhoneNumber( Individual.IndividualResponseBody.PhoneNumber.builder()