diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a2ffaa5..811bbaac 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-java' && '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: @@ -45,7 +45,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/finch-java' && '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: @@ -88,7 +88,7 @@ jobs: test: timeout-minutes: 15 name: test - runs-on: ${{ github.repository == 'stainless-sdks/finch-java' && '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 4fcc351f..e13a9d5c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "8.3.0" + ".": "8.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0fc8637f..d8dd80b1 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 45195292..d75e6c3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 8.4.0 (2026-07-17) + +Full Changelog: [v8.3.0...v8.4.0](https://github.com/Finch-API/finch-api-java/compare/v8.3.0...v8.4.0) + +### Features + +* **api:** api update ([831ea02](https://github.com/Finch-API/finch-api-java/commit/831ea02c3f30a075b8e897bf89ca7f961dbff228)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([ef001e4](https://github.com/Finch-API/finch-api-java/commit/ef001e4cc000b0570e7046973969153dca2100b3)) + ## 8.3.0 (2026-07-15) Full Changelog: [v8.2.0...v8.3.0](https://github.com/Finch-API/finch-api-java/compare/v8.2.0...v8.3.0) diff --git a/README.md b/README.md index bb8454f5..bb2ed29c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/8.3.0) -[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/8.3.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.3.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/8.4.0) +[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/8.4.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.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/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.3.0). +The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.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-java:8.3.0") +implementation("com.tryfinch.api:finch-java:8.4.0") ``` ### Maven @@ -44,7 +44,7 @@ implementation("com.tryfinch.api:finch-java:8.3.0") com.tryfinch.api finch-java - 8.3.0 + 8.4.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index fa9d1b5d..3d32df1a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.tryfinch.api" - version = "8.3.0" // x-release-please-version + version = "8.4.0" // x-release-please-version } subprojects { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt index 5f640389..a08d1321 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt @@ -255,7 +255,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, @@ -263,6 +265,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>, @@ -293,9 +297,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(), @@ -313,6 +323,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(), @@ -333,7 +349,9 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -341,6 +359,8 @@ private constructor( middleName, startDate, title, + unionCode, + unionLocal, customFields, income, incomeHistory, @@ -412,6 +432,16 @@ private constructor( */ fun flsaStatus(): Optional = flsaStatus.getOptional("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(): Optional = + highlyCompensatedEmployee.getOptional("highly_compensated_employee") + /** * `true` if the individual an an active employee or contractor at the company. * @@ -420,6 +450,15 @@ private constructor( */ fun isActive(): Optional = isActive.getOptional("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(): Optional = keyEmployee.getOptional("key_employee") + /** * The legal last name of the individual. * @@ -471,6 +510,23 @@ private constructor( */ fun title(): Optional = title.getOptional("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(): Optional = unionCode.getOptional("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(): Optional = unionLocal.getOptional("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. @@ -579,6 +635,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]. * @@ -586,6 +652,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]. * @@ -640,6 +715,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]. * @@ -712,7 +803,9 @@ private constructor( * .endDate() * .firstName() * .flsaStatus() + * .highlyCompensatedEmployee() * .isActive() + * .keyEmployee() * .lastName() * .latestRehireDate() * .location() @@ -720,6 +813,8 @@ private constructor( * .middleName() * .startDate() * .title() + * .unionCode() + * .unionLocal() * ``` */ @JvmStatic fun builder() = Builder() @@ -736,7 +831,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 @@ -744,6 +841,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 @@ -761,7 +860,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 @@ -769,6 +870,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() } @@ -909,6 +1012,39 @@ 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?) + + /** + * Alias for calling [Builder.highlyCompensatedEmployee] with + * `highlyCompensatedEmployee.orElse(null)`. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Optional) = + highlyCompensatedEmployee(highlyCompensatedEmployee.getOrNull()) + + /** + * 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)) @@ -931,6 +1067,33 @@ 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?) + + /** Alias for calling [Builder.keyEmployee] with `keyEmployee.orElse(null)`. */ + fun keyEmployee(keyEmployee: Optional) = keyEmployee(keyEmployee.getOrNull()) + + /** + * 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)) @@ -1039,6 +1202,39 @@ 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)) + + /** Alias for calling [Builder.unionCode] with `unionCode.orElse(null)`. */ + fun unionCode(unionCode: Optional) = unionCode(unionCode.getOrNull()) + + /** + * 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)) + + /** Alias for calling [Builder.unionLocal] with `unionLocal.orElse(null)`. */ + fun unionLocal(unionLocal: Optional) = unionLocal(unionLocal.getOrNull()) + + /** + * 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. @@ -1190,7 +1386,9 @@ private constructor( * .endDate() * .firstName() * .flsaStatus() + * .highlyCompensatedEmployee() * .isActive() + * .keyEmployee() * .lastName() * .latestRehireDate() * .location() @@ -1198,6 +1396,8 @@ private constructor( * .middleName() * .startDate() * .title() + * .unionCode() + * .unionLocal() * ``` * * @throws IllegalStateException if any required field is unset. @@ -1212,7 +1412,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), @@ -1220,6 +1422,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() }, @@ -1253,7 +1457,9 @@ private constructor( endDate() firstName() flsaStatus().ifPresent { it.validate() } + highlyCompensatedEmployee() isActive() + keyEmployee() lastName() latestRehireDate() location().ifPresent { it.validate() } @@ -1261,6 +1467,8 @@ private constructor( middleName() startDate() title() + unionCode() + unionLocal() customFields().ifPresent { it.forEach { it.validate() } } income().ifPresent { it.validate() } incomeHistory().ifPresent { it.forEach { it?.validate() } } @@ -1293,7 +1501,9 @@ private constructor( (if (endDate.asKnown().isPresent) 1 else 0) + (if (firstName.asKnown().isPresent) 1 else 0) + (flsaStatus.asKnown().getOrNull()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown().isPresent) 1 else 0) + (if (isActive.asKnown().isPresent) 1 else 0) + + (if (keyEmployee.asKnown().isPresent) 1 else 0) + (if (lastName.asKnown().isPresent) 1 else 0) + (if (latestRehireDate.asKnown().isPresent) 1 else 0) + (location.asKnown().getOrNull()?.validity() ?: 0) + @@ -1301,6 +1511,8 @@ private constructor( (if (middleName.asKnown().isPresent) 1 else 0) + (if (startDate.asKnown().isPresent) 1 else 0) + (if (title.asKnown().isPresent) 1 else 0) + + (if (unionCode.asKnown().isPresent) 1 else 0) + + (if (unionLocal.asKnown().isPresent) 1 else 0) + (customFields.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (income.asKnown().getOrNull()?.validity() ?: 0) + (incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } @@ -3011,7 +3223,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 && @@ -3019,6 +3233,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 && @@ -3037,7 +3253,9 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -3045,6 +3263,8 @@ private constructor( middleName, startDate, title, + unionCode, + unionLocal, customFields, income, incomeHistory, @@ -3057,7 +3277,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-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt index 8f314c5f..46c1c2ce 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt @@ -42,9 +42,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, @@ -53,6 +55,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, ) { @@ -77,11 +81,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 @@ -94,6 +104,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, @@ -104,9 +118,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -115,6 +131,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, mutableMapOf(), ) @@ -190,6 +208,16 @@ private constructor( */ fun flsaStatus(): Optional = flsaStatus.getOptional("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(): Optional = + highlyCompensatedEmployee.getOptional("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 @@ -216,6 +244,15 @@ private constructor( */ fun isActive(): Optional = isActive.getOptional("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(): Optional = keyEmployee.getOptional("key_employee") + /** * The legal last name of the individual. * @@ -274,6 +311,23 @@ private constructor( */ fun title(): Optional = title.getOptional("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(): Optional = unionCode.getOptional("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(): Optional = unionLocal.getOptional("union_local") + /** * Returns the raw JSON value of [id]. * @@ -348,6 +402,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]. * @@ -371,6 +435,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]. * @@ -430,6 +503,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) @@ -460,9 +547,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() @@ -471,6 +560,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() @JvmSynthetic @@ -484,9 +575,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 @@ -495,6 +588,8 @@ private constructor( sourceId = employmentUpdateResponse.sourceId startDate = employmentUpdateResponse.startDate title = employmentUpdateResponse.title + unionCode = employmentUpdateResponse.unionCode + unionLocal = employmentUpdateResponse.unionLocal additionalProperties = employmentUpdateResponse.additionalProperties.toMutableMap() } @@ -652,6 +747,39 @@ 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?) + + /** + * Alias for calling [Builder.highlyCompensatedEmployee] with + * `highlyCompensatedEmployee.orElse(null)`. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Optional) = + highlyCompensatedEmployee(highlyCompensatedEmployee.getOrNull()) + + /** + * 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 @@ -723,6 +851,31 @@ 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?) + + /** Alias for calling [Builder.keyEmployee] with `keyEmployee.orElse(null)`. */ + fun keyEmployee(keyEmployee: Optional) = keyEmployee(keyEmployee.getOrNull()) + + /** + * 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)) @@ -840,6 +993,39 @@ 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)) + + /** Alias for calling [Builder.unionCode] with `unionCode.orElse(null)`. */ + fun unionCode(unionCode: Optional) = unionCode(unionCode.getOrNull()) + + /** + * 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)) + + /** Alias for calling [Builder.unionLocal] with `unionLocal.orElse(null)`. */ + fun unionLocal(unionLocal: Optional) = unionLocal(unionLocal.getOrNull()) + + /** + * 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) @@ -875,9 +1061,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, (incomeHistory ?: JsonMissing.of()).map { it.toImmutable() }, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -886,6 +1074,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties.toMutableMap(), ) } @@ -914,9 +1104,11 @@ private constructor( endDate() firstName() flsaStatus().ifPresent { it.validate() } + highlyCompensatedEmployee() income().ifPresent { it.validate() } incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() + keyEmployee() lastName() latestRehireDate() location().ifPresent { it.validate() } @@ -925,6 +1117,8 @@ private constructor( sourceId() startDate() title() + unionCode() + unionLocal() validated = true } @@ -952,9 +1146,11 @@ private constructor( (if (endDate.asKnown().isPresent) 1 else 0) + (if (firstName.asKnown().isPresent) 1 else 0) + (flsaStatus.asKnown().getOrNull()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown().isPresent) 1 else 0) + (income.asKnown().getOrNull()?.validity() ?: 0) + (incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (isActive.asKnown().isPresent) 1 else 0) + + (if (keyEmployee.asKnown().isPresent) 1 else 0) + (if (lastName.asKnown().isPresent) 1 else 0) + (if (latestRehireDate.asKnown().isPresent) 1 else 0) + (location.asKnown().getOrNull()?.validity() ?: 0) + @@ -962,7 +1158,9 @@ private constructor( (if (middleName.asKnown().isPresent) 1 else 0) + (if (sourceId.asKnown().isPresent) 1 else 0) + (if (startDate.asKnown().isPresent) 1 else 0) + - (if (title.asKnown().isPresent) 1 else 0) + (if (title.asKnown().isPresent) 1 else 0) + + (if (unionCode.asKnown().isPresent) 1 else 0) + + (if (unionLocal.asKnown().isPresent) 1 else 0) class CustomField @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2577,9 +2775,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 && @@ -2588,6 +2788,8 @@ private constructor( sourceId == other.sourceId && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && additionalProperties == other.additionalProperties } @@ -2602,9 +2804,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -2613,6 +2817,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties, ) } @@ -2620,5 +2826,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-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt index 43273682..dd45c39b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt @@ -249,6 +249,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, @@ -273,6 +274,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(), @@ -299,6 +303,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -355,6 +360,15 @@ private constructor( */ fun lastName(): Optional = lastName.getOptional("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(): Optional = maritalStatus.getOptional("marital_status") + /** * The legal middle name of the individual. * @@ -453,6 +467,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]. * @@ -538,6 +562,7 @@ private constructor( * .firstName() * .gender() * .lastName() + * .maritalStatus() * .middleName() * .phoneNumbers() * .preferredName() @@ -556,6 +581,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 @@ -573,6 +599,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 @@ -669,6 +696,28 @@ 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)) + + /** Alias for calling [Builder.maritalStatus] with `maritalStatus.orElse(null)`. */ + fun maritalStatus(maritalStatus: Optional) = + maritalStatus(maritalStatus.getOrNull()) + + /** + * 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)) @@ -849,6 +898,7 @@ private constructor( * .firstName() * .gender() * .lastName() + * .maritalStatus() * .middleName() * .phoneNumbers() * .preferredName() @@ -865,6 +915,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), @@ -898,6 +949,7 @@ private constructor( firstName() gender().ifPresent { it.validate() } lastName() + maritalStatus().ifPresent { it.validate() } middleName() phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() @@ -930,6 +982,7 @@ private constructor( (if (firstName.asKnown().isPresent) 1 else 0) + (gender.asKnown().getOrNull()?.validity() ?: 0) + (if (lastName.asKnown().isPresent) 1 else 0) + + (maritalStatus.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (phoneNumbers.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown().isPresent) 1 else 0) + @@ -1270,6 +1323,175 @@ 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 { + + @JvmField val SINGLE = of("single") + + @JvmField val MARRIED = of("married") + + @JvmField val DIVORCED = of("divorced") + + @JvmField val WIDOWED = of("widowed") + + @JvmField val DOMESTIC_PARTNER = of("domestic_partner") + + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic 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().orElseThrow { + 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. + */ + @JvmSynthetic 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( @@ -1982,6 +2204,7 @@ private constructor( firstName == other.firstName && gender == other.gender && lastName == other.lastName && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -2000,6 +2223,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -2014,7 +2238,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-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt index 40112fa1..e2cf79b1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualUpdateResponse.kt @@ -30,6 +30,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, @@ -52,6 +53,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(), @@ -74,6 +78,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -144,6 +149,15 @@ private constructor( */ fun lastName(): Optional = lastName.getOptional("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(): Optional = maritalStatus.getOptional("marital_status") + /** * The legal middle name of the individual. * @@ -240,6 +254,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]. * @@ -308,6 +331,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() @@ -325,6 +349,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 @@ -464,6 +489,28 @@ 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)) + + /** Alias for calling [Builder.maritalStatus] with `maritalStatus.orElse(null)`. */ + fun maritalStatus(maritalStatus: Optional) = + maritalStatus(maritalStatus.getOrNull()) + + /** + * 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)) @@ -594,6 +641,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, (phoneNumbers ?: JsonMissing.of()).map { it.toImmutable() }, preferredName, @@ -626,6 +674,7 @@ private constructor( firstName() gender().ifPresent { it.validate() } lastName() + maritalStatus().ifPresent { it.validate() } middleName() phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() @@ -657,6 +706,7 @@ private constructor( (if (firstName.asKnown().isPresent) 1 else 0) + (gender.asKnown().getOrNull()?.validity() ?: 0) + (if (lastName.asKnown().isPresent) 1 else 0) + + (maritalStatus.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (phoneNumbers.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown().isPresent) 1 else 0) + @@ -1301,6 +1351,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 { + + @JvmField val SINGLE = of("single") + + @JvmField val MARRIED = of("married") + + @JvmField val DIVORCED = of("divorced") + + @JvmField val WIDOWED = of("widowed") + + @JvmField val DOMESTIC_PARTNER = of("domestic_partner") + + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic 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().orElseThrow { 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. + */ + @JvmSynthetic 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( @@ -1637,6 +1852,7 @@ private constructor( firstName == other.firstName && gender == other.gender && lastName == other.lastName && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -1655,6 +1871,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -1667,5 +1884,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-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index dfff7f55..dff3cf38 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt @@ -230,13 +230,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, @@ -245,6 +248,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, ) { @@ -283,6 +288,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 @@ -290,6 +298,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(), @@ -300,6 +311,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(), @@ -320,6 +334,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, @@ -334,13 +354,16 @@ private constructor( firstName, flsaStatus, gender, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, manager, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -349,6 +372,8 @@ private constructor( ssn, startDate, title, + unionCode, + unionLocal, mutableMapOf(), ) @@ -454,6 +479,16 @@ private constructor( */ fun gender(): Optional = gender.getOptional("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(): Optional = + highlyCompensatedEmployee.getOptional("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 @@ -480,6 +515,15 @@ private constructor( */ fun isActive(): Optional = isActive.getOptional("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(): Optional = keyEmployee.getOptional("key_employee") + /** * The legal last name of the individual. * @@ -509,6 +553,15 @@ private constructor( */ fun manager(): Optional = manager.getOptional("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(): Optional = maritalStatus.getOptional("marital_status") + /** * The legal middle name of the individual. * @@ -569,6 +622,23 @@ private constructor( */ fun title(): Optional = title.getOptional("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(): Optional = unionCode.getOptional("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(): Optional = unionLocal.getOptional("union_local") + /** * Returns the raw JSON value of [classCode]. * @@ -677,6 +747,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]. * @@ -701,6 +781,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]. * @@ -732,6 +821,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]. * @@ -796,6 +895,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) @@ -832,13 +947,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() @@ -847,6 +965,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() @JvmSynthetic @@ -864,13 +984,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 @@ -879,6 +1002,8 @@ private constructor( ssn = individualOrEmployment.ssn startDate = individualOrEmployment.startDate title = individualOrEmployment.title + unionCode = individualOrEmployment.unionCode + unionLocal = individualOrEmployment.unionLocal additionalProperties = individualOrEmployment.additionalProperties.toMutableMap() } @@ -1130,6 +1255,39 @@ 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?) + + /** + * Alias for calling [Builder.highlyCompensatedEmployee] with + * `highlyCompensatedEmployee.orElse(null)`. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Optional) = + highlyCompensatedEmployee(highlyCompensatedEmployee.getOrNull()) + + /** + * 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 @@ -1202,6 +1360,33 @@ 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?) + + /** Alias for calling [Builder.keyEmployee] with `keyEmployee.orElse(null)`. */ + fun keyEmployee(keyEmployee: Optional) = keyEmployee(keyEmployee.getOrNull()) + + /** + * 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)) @@ -1266,6 +1451,28 @@ 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)) + + /** Alias for calling [Builder.maritalStatus] with `maritalStatus.orElse(null)`. */ + fun maritalStatus(maritalStatus: Optional) = + maritalStatus(maritalStatus.getOrNull()) + + /** + * 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)) @@ -1407,6 +1614,39 @@ 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)) + + /** Alias for calling [Builder.unionCode] with `unionCode.orElse(null)`. */ + fun unionCode(unionCode: Optional) = unionCode(unionCode.getOrNull()) + + /** + * 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)) + + /** Alias for calling [Builder.unionLocal] with `unionLocal.orElse(null)`. */ + fun unionLocal(unionLocal: Optional) = unionLocal(unionLocal.getOrNull()) + + /** + * 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) @@ -1446,13 +1686,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, @@ -1461,6 +1704,8 @@ private constructor( ssn, startDate, title, + unionCode, + unionLocal, additionalProperties.toMutableMap(), ) } @@ -1494,13 +1739,16 @@ private constructor( firstName() flsaStatus().ifPresent { it.validate() } gender().ifPresent { it.validate() } + highlyCompensatedEmployee() income().ifPresent { it.validate() } incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() + keyEmployee() lastName() latestRehireDate() location().ifPresent { it.validate() } manager().ifPresent { it.validate() } + maritalStatus().ifPresent { it.validate() } middleName() phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() @@ -1509,6 +1757,8 @@ private constructor( ssn() startDate() title() + unionCode() + unionLocal() validated = true } @@ -1541,14 +1791,17 @@ private constructor( (if (firstName.asKnown().isPresent) 1 else 0) + (flsaStatus.asKnown().getOrNull()?.validity() ?: 0) + (gender.asKnown().getOrNull()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown().isPresent) 1 else 0) + (income.asKnown().getOrNull()?.validity() ?: 0) + (incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (isActive.asKnown().isPresent) 1 else 0) + + (if (keyEmployee.asKnown().isPresent) 1 else 0) + (if (lastName.asKnown().isPresent) 1 else 0) + (if (latestRehireDate.asKnown().isPresent) 1 else 0) + (location.asKnown().getOrNull()?.validity() ?: 0) + (manager.asKnown().getOrNull()?.validity() ?: 0) + + (maritalStatus.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (phoneNumbers.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown().isPresent) 1 else 0) + @@ -1556,7 +1809,9 @@ private constructor( (if (sourceId.asKnown().isPresent) 1 else 0) + (if (ssn.asKnown().isPresent) 1 else 0) + (if (startDate.asKnown().isPresent) 1 else 0) + - (if (title.asKnown().isPresent) 1 else 0) + (if (title.asKnown().isPresent) 1 else 0) + + (if (unionCode.asKnown().isPresent) 1 else 0) + + (if (unionLocal.asKnown().isPresent) 1 else 0) class CustomField @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3855,6 +4110,175 @@ 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 { + + @JvmField val SINGLE = of("single") + + @JvmField val MARRIED = of("married") + + @JvmField val DIVORCED = of("divorced") + + @JvmField val WIDOWED = of("widowed") + + @JvmField val DOMESTIC_PARTNER = of("domestic_partner") + + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic 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().orElseThrow { + 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. + */ + @JvmSynthetic 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( @@ -4205,13 +4629,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 && @@ -4220,6 +4647,8 @@ private constructor( ssn == other.ssn && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && additionalProperties == other.additionalProperties } @@ -4238,13 +4667,16 @@ private constructor( firstName, flsaStatus, gender, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, manager, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -4253,6 +4685,8 @@ private constructor( ssn, startDate, title, + unionCode, + unionLocal, additionalProperties, ) } @@ -4260,7 +4694,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-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 1e4c0d1d..b13dec6b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt @@ -107,6 +107,15 @@ private constructor( */ fun flsaStatus(): Optional = 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(): Optional = 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 @@ -133,6 +142,15 @@ private constructor( */ fun isActive(): Optional = 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(): Optional = body.keyEmployee() + /** * The legal last name of the individual. * @@ -191,6 +209,23 @@ private constructor( */ fun title(): Optional = 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(): Optional = 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(): Optional = body.unionLocal() + /** * Returns the raw JSON value of [classCode]. * @@ -248,6 +283,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]. * @@ -269,6 +312,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]. * @@ -326,6 +376,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. */ @@ -522,6 +586,40 @@ 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?) + + /** + * Alias for calling [Builder.highlyCompensatedEmployee] with + * `highlyCompensatedEmployee.orElse(null)`. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Optional) = + highlyCompensatedEmployee(highlyCompensatedEmployee.getOrNull()) + + /** + * 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 @@ -589,6 +687,31 @@ 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?) + + /** Alias for calling [Builder.keyEmployee] with `keyEmployee.orElse(null)`. */ + fun keyEmployee(keyEmployee: Optional) = keyEmployee(keyEmployee.getOrNull()) + + /** + * 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) } @@ -707,6 +830,39 @@ 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) } + + /** Alias for calling [Builder.unionCode] with `unionCode.orElse(null)`. */ + fun unionCode(unionCode: Optional) = unionCode(unionCode.getOrNull()) + + /** + * 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) } + + /** Alias for calling [Builder.unionLocal] with `unionLocal.orElse(null)`. */ + fun unionLocal(unionLocal: Optional) = unionLocal(unionLocal.getOrNull()) + + /** + * 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) } @@ -861,9 +1017,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, @@ -872,6 +1030,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, ) { @@ -899,6 +1059,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 @@ -906,6 +1069,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(), @@ -926,6 +1092,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, @@ -935,9 +1107,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -946,6 +1120,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, mutableMapOf(), ) @@ -1013,6 +1189,16 @@ private constructor( */ fun flsaStatus(): Optional = flsaStatus.getOptional("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(): Optional = + highlyCompensatedEmployee.getOptional("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 @@ -1039,6 +1225,15 @@ private constructor( */ fun isActive(): Optional = isActive.getOptional("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(): Optional = keyEmployee.getOptional("key_employee") + /** * The legal last name of the individual. * @@ -1098,6 +1293,23 @@ private constructor( */ fun title(): Optional = title.getOptional("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(): Optional = unionCode.getOptional("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(): Optional = unionLocal.getOptional("union_local") + /** * Returns the raw JSON value of [classCode]. * @@ -1166,6 +1378,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]. * @@ -1190,6 +1412,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]. * @@ -1251,6 +1482,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) @@ -1280,9 +1527,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() @@ -1291,6 +1540,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() @JvmSynthetic @@ -1303,9 +1554,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 @@ -1314,6 +1567,8 @@ private constructor( sourceId = employmentWithoutId.sourceId startDate = employmentWithoutId.startDate title = employmentWithoutId.title + unionCode = employmentWithoutId.unionCode + unionLocal = employmentWithoutId.unionLocal additionalProperties = employmentWithoutId.additionalProperties.toMutableMap() } @@ -1470,6 +1725,39 @@ 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?) + + /** + * Alias for calling [Builder.highlyCompensatedEmployee] with + * `highlyCompensatedEmployee.orElse(null)`. + */ + fun highlyCompensatedEmployee(highlyCompensatedEmployee: Optional) = + highlyCompensatedEmployee(highlyCompensatedEmployee.getOrNull()) + + /** + * 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 @@ -1542,6 +1830,33 @@ 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?) + + /** Alias for calling [Builder.keyEmployee] with `keyEmployee.orElse(null)`. */ + fun keyEmployee(keyEmployee: Optional) = keyEmployee(keyEmployee.getOrNull()) + + /** + * 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)) @@ -1665,6 +1980,39 @@ 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)) + + /** Alias for calling [Builder.unionCode] with `unionCode.orElse(null)`. */ + fun unionCode(unionCode: Optional) = unionCode(unionCode.getOrNull()) + + /** + * 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)) + + /** Alias for calling [Builder.unionLocal] with `unionLocal.orElse(null)`. */ + fun unionLocal(unionLocal: Optional) = unionLocal(unionLocal.getOrNull()) + + /** + * 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) @@ -1699,9 +2047,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, (incomeHistory ?: JsonMissing.of()).map { it.toImmutable() }, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -1710,6 +2060,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties.toMutableMap(), ) } @@ -1738,9 +2090,11 @@ private constructor( endDate() firstName() flsaStatus().ifPresent { it.validate() } + highlyCompensatedEmployee() income().ifPresent { it.validate() } incomeHistory().ifPresent { it.forEach { it?.validate() } } isActive() + keyEmployee() lastName() latestRehireDate() location().ifPresent { it.validate() } @@ -1749,6 +2103,8 @@ private constructor( sourceId() startDate() title() + unionCode() + unionLocal() validated = true } @@ -1776,10 +2132,12 @@ private constructor( (if (endDate.asKnown().isPresent) 1 else 0) + (if (firstName.asKnown().isPresent) 1 else 0) + (flsaStatus.asKnown().getOrNull()?.validity() ?: 0) + + (if (highlyCompensatedEmployee.asKnown().isPresent) 1 else 0) + (income.asKnown().getOrNull()?.validity() ?: 0) + (incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (isActive.asKnown().isPresent) 1 else 0) + + (if (keyEmployee.asKnown().isPresent) 1 else 0) + (if (lastName.asKnown().isPresent) 1 else 0) + (if (latestRehireDate.asKnown().isPresent) 1 else 0) + (location.asKnown().getOrNull()?.validity() ?: 0) + @@ -1787,7 +2145,9 @@ private constructor( (if (middleName.asKnown().isPresent) 1 else 0) + (if (sourceId.asKnown().isPresent) 1 else 0) + (if (startDate.asKnown().isPresent) 1 else 0) + - (if (title.asKnown().isPresent) 1 else 0) + (if (title.asKnown().isPresent) 1 else 0) + + (if (unionCode.asKnown().isPresent) 1 else 0) + + (if (unionLocal.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1803,9 +2163,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 && @@ -1814,6 +2176,8 @@ private constructor( sourceId == other.sourceId && startDate == other.startDate && title == other.title && + unionCode == other.unionCode && + unionLocal == other.unionLocal && additionalProperties == other.additionalProperties } @@ -1827,9 +2191,11 @@ private constructor( endDate, firstName, flsaStatus, + highlyCompensatedEmployee, income, incomeHistory, isActive, + keyEmployee, lastName, latestRehireDate, location, @@ -1838,6 +2204,8 @@ private constructor( sourceId, startDate, title, + unionCode, + unionLocal, additionalProperties, ) } @@ -1845,7 +2213,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-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 76f7b6c4..389e1a32 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt @@ -87,6 +87,15 @@ private constructor( */ fun lastName(): Optional = 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(): Optional = body.maritalStatus() + /** * The legal middle name of the individual. * @@ -174,6 +183,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]. * @@ -378,6 +394,29 @@ 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) + } + + /** Alias for calling [Builder.maritalStatus] with `maritalStatus.orElse(null)`. */ + fun maritalStatus(maritalStatus: Optional) = + maritalStatus(maritalStatus.getOrNull()) + + /** + * 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) } @@ -622,6 +661,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, @@ -649,6 +689,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(), @@ -670,6 +713,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -732,6 +776,15 @@ private constructor( */ fun lastName(): Optional = lastName.getOptional("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(): Optional = maritalStatus.getOptional("marital_status") + /** * The legal middle name of the individual. * @@ -824,6 +877,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]. * @@ -895,6 +958,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() @@ -911,6 +975,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 @@ -1044,6 +1109,28 @@ 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)) + + /** Alias for calling [Builder.maritalStatus] with `maritalStatus.orElse(null)`. */ + fun maritalStatus(maritalStatus: Optional) = + maritalStatus(maritalStatus.getOrNull()) + + /** + * 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)) @@ -1174,6 +1261,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, (phoneNumbers ?: JsonMissing.of()).map { it.toImmutable() }, preferredName, @@ -1206,6 +1294,7 @@ private constructor( firstName() gender().ifPresent { it.validate() } lastName() + maritalStatus().ifPresent { it.validate() } middleName() phoneNumbers().ifPresent { it.forEach { it?.validate() } } preferredName() @@ -1237,6 +1326,7 @@ private constructor( (if (firstName.asKnown().isPresent) 1 else 0) + (gender.asKnown().getOrNull()?.validity() ?: 0) + (if (lastName.asKnown().isPresent) 1 else 0) + + (maritalStatus.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (phoneNumbers.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) + (if (preferredName.asKnown().isPresent) 1 else 0) + @@ -1256,6 +1346,7 @@ private constructor( firstName == other.firstName && gender == other.gender && lastName == other.lastName && + maritalStatus == other.maritalStatus && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && @@ -1273,6 +1364,7 @@ private constructor( firstName, gender, lastName, + maritalStatus, middleName, phoneNumbers, preferredName, @@ -1285,7 +1377,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 @@ -1926,6 +2018,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 { + + @JvmField val SINGLE = of("single") + + @JvmField val MARRIED = of("married") + + @JvmField val DIVORCED = of("divorced") + + @JvmField val WIDOWED = of("widowed") + + @JvmField val DOMESTIC_PARTNER = of("domestic_partner") + + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic 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().orElseThrow { 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. + */ + @JvmSynthetic 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-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt index 5d61fcf4..8bf8ae3a 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt index 0a1bcbc1..4845ca1d 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt index 099d15ec..7937d1bb 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt @@ -34,6 +34,7 @@ internal class EmploymentUpdateResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentUpdateResponse.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -51,6 +52,7 @@ internal class EmploymentUpdateResponseTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -74,6 +76,8 @@ internal class EmploymentUpdateResponseTest { .sourceId("source_id") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() assertThat(employmentUpdateResponse.id()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -97,6 +101,7 @@ internal class EmploymentUpdateResponseTest { assertThat(employmentUpdateResponse.firstName()).contains("first_name") assertThat(employmentUpdateResponse.flsaStatus()) .contains(EmploymentUpdateResponse.FlsaStatus.EXEMPT) + assertThat(employmentUpdateResponse.highlyCompensatedEmployee()).contains(true) assertThat(employmentUpdateResponse.income()) .contains( Income.builder() @@ -116,6 +121,7 @@ internal class EmploymentUpdateResponseTest { .build() ) assertThat(employmentUpdateResponse.isActive()).contains(true) + assertThat(employmentUpdateResponse.keyEmployee()).contains(true) assertThat(employmentUpdateResponse.lastName()).contains("last_name") assertThat(employmentUpdateResponse.latestRehireDate()).contains("latest_rehire_date") assertThat(employmentUpdateResponse.location()) @@ -141,6 +147,8 @@ internal class EmploymentUpdateResponseTest { assertThat(employmentUpdateResponse.sourceId()).contains("source_id") assertThat(employmentUpdateResponse.startDate()).contains("start_date") assertThat(employmentUpdateResponse.title()).contains("title") + assertThat(employmentUpdateResponse.unionCode()).contains("union_code") + assertThat(employmentUpdateResponse.unionLocal()).contains("union_local") } @Test @@ -167,6 +175,7 @@ internal class EmploymentUpdateResponseTest { .endDate("end_date") .firstName("first_name") .flsaStatus(EmploymentUpdateResponse.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -184,6 +193,7 @@ internal class EmploymentUpdateResponseTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -207,6 +217,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-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt index ca53f56f..1dbfd603 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt index 8127fd80..e791fd07 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyPageResponseTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt index bc0698bd..542518b2 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualResponseTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt index 4efa33da..cc69b924 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt index 94683bcd..eb6f8451 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/IndividualUpdateResponseTest.kt @@ -27,6 +27,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() @@ -66,6 +67,8 @@ internal class IndividualUpdateResponseTest { assertThat(individualUpdateResponse.gender()) .contains(IndividualUpdateResponse.Gender.FEMALE) assertThat(individualUpdateResponse.lastName()).contains("last_name") + assertThat(individualUpdateResponse.maritalStatus()) + .contains(IndividualUpdateResponse.MaritalStatus.SINGLE) assertThat(individualUpdateResponse.middleName()).contains("middle_name") assertThat(individualUpdateResponse.phoneNumbers().getOrNull()) .containsExactly( @@ -109,6 +112,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-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt index 430495ff..0ea40836 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParamsTest.kt @@ -59,6 +59,7 @@ internal class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -76,6 +77,7 @@ internal class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -95,6 +97,9 @@ internal class SandboxDirectoryCreateParamsTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber.builder() @@ -122,6 +127,8 @@ internal class SandboxDirectoryCreateParamsTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) .build() @@ -184,6 +191,7 @@ internal class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -201,6 +209,7 @@ internal class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -220,6 +229,9 @@ internal class SandboxDirectoryCreateParamsTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber @@ -249,6 +261,8 @@ internal class SandboxDirectoryCreateParamsTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) .build() @@ -303,6 +317,7 @@ internal class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.IndividualOrEmployment.FlsaStatus.EXEMPT ) .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -320,6 +335,7 @@ internal class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -339,6 +355,9 @@ internal class SandboxDirectoryCreateParamsTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) + .maritalStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.MaritalStatus.SINGLE + ) .middleName("middle_name") .addPhoneNumber( SandboxDirectoryCreateParams.IndividualOrEmployment.PhoneNumber.builder() @@ -366,6 +385,8 @@ internal class SandboxDirectoryCreateParamsTest { .ssn("ssn") .startDate("start_date") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() ) } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt index c26a651c..59f5c6a1 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParamsTest.kt @@ -31,6 +31,7 @@ internal class SandboxEmploymentUpdateParamsTest { .endDate("end_date") .firstName("first_name") .flsaStatus(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -48,6 +49,7 @@ internal class SandboxEmploymentUpdateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -71,6 +73,8 @@ internal class SandboxEmploymentUpdateParamsTest { .sourceId("source_id") .startDate("3/4/2020") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() } @@ -106,6 +110,7 @@ internal class SandboxEmploymentUpdateParamsTest { .endDate("end_date") .firstName("first_name") .flsaStatus(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + .highlyCompensatedEmployee(true) .income( Income.builder() .amount(0L) @@ -123,6 +128,7 @@ internal class SandboxEmploymentUpdateParamsTest { .build() ) .isActive(true) + .keyEmployee(true) .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( @@ -146,6 +152,8 @@ internal class SandboxEmploymentUpdateParamsTest { .sourceId("source_id") .startDate("3/4/2020") .title("title") + .unionCode("union_code") + .unionLocal("union_local") .build() val body = params._body() @@ -172,6 +180,7 @@ internal class SandboxEmploymentUpdateParamsTest { assertThat(body.endDate()).contains("end_date") assertThat(body.firstName()).contains("first_name") assertThat(body.flsaStatus()).contains(SandboxEmploymentUpdateParams.FlsaStatus.EXEMPT) + assertThat(body.highlyCompensatedEmployee()).contains(true) assertThat(body.income()) .contains( Income.builder() @@ -191,6 +200,7 @@ internal class SandboxEmploymentUpdateParamsTest { .build() ) assertThat(body.isActive()).contains(true) + assertThat(body.keyEmployee()).contains(true) assertThat(body.lastName()).contains("last_name") assertThat(body.latestRehireDate()).contains("latest_rehire_date") assertThat(body.location()) @@ -216,6 +226,8 @@ internal class SandboxEmploymentUpdateParamsTest { assertThat(body.sourceId()).contains("source_id") assertThat(body.startDate()).contains("3/4/2020") assertThat(body.title()).contains("title") + assertThat(body.unionCode()).contains("union_code") + assertThat(body.unionLocal()).contains("union_local") } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt index f1846ca4..a489f8c6 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt @@ -24,6 +24,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() @@ -74,6 +75,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() @@ -112,6 +114,8 @@ internal class SandboxIndividualUpdateParamsTest { assertThat(body.firstName()).contains("first_name") assertThat(body.gender()).contains(SandboxIndividualUpdateParams.Gender.FEMALE) assertThat(body.lastName()).contains("last_name") + assertThat(body.maritalStatus()) + .contains(SandboxIndividualUpdateParams.MaritalStatus.SINGLE) assertThat(body.middleName()).contains("middle_name") assertThat(body.phoneNumbers().getOrNull()) .containsExactly( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt index d85153b3..28badb39 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsyncTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt index 30932764..28fef387 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsyncTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt index 5ae62990..35a5cb41 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsyncTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt index 43c9a960..e6316cb2 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryServiceTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt index 9890da4f..e80d5a5c 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentServiceTest.kt +++ b/finch-java-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-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt index 2c097a2e..5b3c22db 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualServiceTest.kt +++ b/finch-java-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-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt b/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt index f814835d..791eee33 100644 --- a/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt +++ b/finch-java-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()