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 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-kotlin/9.3.0)
-[](https://javadoc.io/doc/com.tryfinch.api/finch-kotlin/9.3.0)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-kotlin/9.4.0)
+[](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