Skip to content

Commit c5fd789

Browse files
feat(api): api update
1 parent 5737bc6 commit c5fd789

File tree

5 files changed

+55
-56
lines changed

5 files changed

+55
-56
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 45
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-5b00a0bc705b1d5bfcb5ea79c7af544766d51ec12ccc4721825664ab397789d8.yml
3-
openapi_spec_hash: 34891659cff31395ba7683a8153b1db5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-dbbf65e94ae7a53cd5a313974761102447ccda3096fd40967c137ad3f80f7154.yml
3+
openapi_spec_hash: 3cc9d87b60dc27283735d610d4b51a53
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@ private constructor(
219219
private val location: JsonField<Location>,
220220
private val manager: JsonField<Manager>,
221221
private val middleName: JsonField<String>,
222-
private val sourceId: JsonField<String>,
223222
private val startDate: JsonField<String>,
224223
private val title: JsonField<String>,
225224
private val workId: JsonField<String>,
226225
private val income: JsonField<Income>,
227226
private val incomeHistory: JsonField<List<Income?>>,
227+
private val sourceId: JsonField<String>,
228228
private val additionalProperties: MutableMap<String, JsonValue>,
229229
) {
230230

@@ -266,9 +266,6 @@ private constructor(
266266
@JsonProperty("middle_name")
267267
@ExcludeMissing
268268
middleName: JsonField<String> = JsonMissing.of(),
269-
@JsonProperty("source_id")
270-
@ExcludeMissing
271-
sourceId: JsonField<String> = JsonMissing.of(),
272269
@JsonProperty("start_date")
273270
@ExcludeMissing
274271
startDate: JsonField<String> = JsonMissing.of(),
@@ -278,6 +275,9 @@ private constructor(
278275
@JsonProperty("income_history")
279276
@ExcludeMissing
280277
incomeHistory: JsonField<List<Income?>> = JsonMissing.of(),
278+
@JsonProperty("source_id")
279+
@ExcludeMissing
280+
sourceId: JsonField<String> = JsonMissing.of(),
281281
) : this(
282282
id,
283283
classCode,
@@ -293,12 +293,12 @@ private constructor(
293293
location,
294294
manager,
295295
middleName,
296-
sourceId,
297296
startDate,
298297
title,
299298
workId,
300299
income,
301300
incomeHistory,
301+
sourceId,
302302
mutableMapOf(),
303303
)
304304

@@ -412,14 +412,6 @@ private constructor(
412412
*/
413413
fun middleName(): Optional<String> = middleName.getOptional("middle_name")
414414

415-
/**
416-
* The source system's unique employment identifier for this individual
417-
*
418-
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
419-
* server responded with an unexpected value).
420-
*/
421-
fun sourceId(): Optional<String> = sourceId.getOptional("source_id")
422-
423415
/**
424416
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
425417
* server responded with an unexpected value).
@@ -460,6 +452,14 @@ private constructor(
460452
*/
461453
fun incomeHistory(): Optional<List<Income?>> = incomeHistory.getOptional("income_history")
462454

455+
/**
456+
* The source system's unique employment identifier for this individual
457+
*
458+
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
459+
* server responded with an unexpected value).
460+
*/
461+
fun sourceId(): Optional<String> = sourceId.getOptional("source_id")
462+
463463
/**
464464
* Returns the raw JSON value of [id].
465465
*
@@ -573,13 +573,6 @@ private constructor(
573573
@ExcludeMissing
574574
fun _middleName(): JsonField<String> = middleName
575575

576-
/**
577-
* Returns the raw JSON value of [sourceId].
578-
*
579-
* Unlike [sourceId], this method doesn't throw if the JSON field has an unexpected type.
580-
*/
581-
@JsonProperty("source_id") @ExcludeMissing fun _sourceId(): JsonField<String> = sourceId
582-
583576
/**
584577
* Returns the raw JSON value of [startDate].
585578
*
@@ -621,6 +614,13 @@ private constructor(
621614
@ExcludeMissing
622615
fun _incomeHistory(): JsonField<List<Income?>> = incomeHistory
623616

617+
/**
618+
* Returns the raw JSON value of [sourceId].
619+
*
620+
* Unlike [sourceId], this method doesn't throw if the JSON field has an unexpected type.
621+
*/
622+
@JsonProperty("source_id") @ExcludeMissing fun _sourceId(): JsonField<String> = sourceId
623+
624624
@JsonAnySetter
625625
private fun putAdditionalProperty(key: String, value: JsonValue) {
626626
additionalProperties.put(key, value)
@@ -654,7 +654,6 @@ private constructor(
654654
* .location()
655655
* .manager()
656656
* .middleName()
657-
* .sourceId()
658657
* .startDate()
659658
* .title()
660659
* .workId()
@@ -680,12 +679,12 @@ private constructor(
680679
private var location: JsonField<Location>? = null
681680
private var manager: JsonField<Manager>? = null
682681
private var middleName: JsonField<String>? = null
683-
private var sourceId: JsonField<String>? = null
684682
private var startDate: JsonField<String>? = null
685683
private var title: JsonField<String>? = null
686684
private var workId: JsonField<String>? = null
687685
private var income: JsonField<Income> = JsonMissing.of()
688686
private var incomeHistory: JsonField<MutableList<Income?>>? = null
687+
private var sourceId: JsonField<String> = JsonMissing.of()
689688
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
690689

691690
@JvmSynthetic
@@ -704,12 +703,12 @@ private constructor(
704703
location = unionMember0.location
705704
manager = unionMember0.manager
706705
middleName = unionMember0.middleName
707-
sourceId = unionMember0.sourceId
708706
startDate = unionMember0.startDate
709707
title = unionMember0.title
710708
workId = unionMember0.workId
711709
income = unionMember0.income
712710
incomeHistory = unionMember0.incomeHistory.map { it.toMutableList() }
711+
sourceId = unionMember0.sourceId
713712
additionalProperties = unionMember0.additionalProperties.toMutableMap()
714713
}
715714

@@ -962,21 +961,6 @@ private constructor(
962961
*/
963962
fun middleName(middleName: JsonField<String>) = apply { this.middleName = middleName }
964963

965-
/** The source system's unique employment identifier for this individual */
966-
fun sourceId(sourceId: String?) = sourceId(JsonField.ofNullable(sourceId))
967-
968-
/** Alias for calling [Builder.sourceId] with `sourceId.orElse(null)`. */
969-
fun sourceId(sourceId: Optional<String>) = sourceId(sourceId.getOrNull())
970-
971-
/**
972-
* Sets [Builder.sourceId] to an arbitrary JSON value.
973-
*
974-
* You should usually call [Builder.sourceId] with a well-typed [String] value instead.
975-
* This method is primarily for setting the field to an undocumented or not yet
976-
* supported value.
977-
*/
978-
fun sourceId(sourceId: JsonField<String>) = apply { this.sourceId = sourceId }
979-
980964
fun startDate(startDate: String?) = startDate(JsonField.ofNullable(startDate))
981965

982966
/** Alias for calling [Builder.startDate] with `startDate.orElse(null)`. */
@@ -1074,6 +1058,21 @@ private constructor(
10741058
}
10751059
}
10761060

1061+
/** The source system's unique employment identifier for this individual */
1062+
fun sourceId(sourceId: String?) = sourceId(JsonField.ofNullable(sourceId))
1063+
1064+
/** Alias for calling [Builder.sourceId] with `sourceId.orElse(null)`. */
1065+
fun sourceId(sourceId: Optional<String>) = sourceId(sourceId.getOrNull())
1066+
1067+
/**
1068+
* Sets [Builder.sourceId] to an arbitrary JSON value.
1069+
*
1070+
* You should usually call [Builder.sourceId] with a well-typed [String] value instead.
1071+
* This method is primarily for setting the field to an undocumented or not yet
1072+
* supported value.
1073+
*/
1074+
fun sourceId(sourceId: JsonField<String>) = apply { this.sourceId = sourceId }
1075+
10771076
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
10781077
this.additionalProperties.clear()
10791078
putAllAdditionalProperties(additionalProperties)
@@ -1114,7 +1113,6 @@ private constructor(
11141113
* .location()
11151114
* .manager()
11161115
* .middleName()
1117-
* .sourceId()
11181116
* .startDate()
11191117
* .title()
11201118
* .workId()
@@ -1138,12 +1136,12 @@ private constructor(
11381136
checkRequired("location", location),
11391137
checkRequired("manager", manager),
11401138
checkRequired("middleName", middleName),
1141-
checkRequired("sourceId", sourceId),
11421139
checkRequired("startDate", startDate),
11431140
checkRequired("title", title),
11441141
checkRequired("workId", workId),
11451142
income,
11461143
(incomeHistory ?: JsonMissing.of()).map { it.toImmutable() },
1144+
sourceId,
11471145
additionalProperties.toMutableMap(),
11481146
)
11491147
}
@@ -1169,12 +1167,12 @@ private constructor(
11691167
location().ifPresent { it.validate() }
11701168
manager().ifPresent { it.validate() }
11711169
middleName()
1172-
sourceId()
11731170
startDate()
11741171
title()
11751172
workId()
11761173
income().ifPresent { it.validate() }
11771174
incomeHistory().ifPresent { it.forEach { it?.validate() } }
1175+
sourceId()
11781176
validated = true
11791177
}
11801178

@@ -1208,12 +1206,13 @@ private constructor(
12081206
(location.asKnown().getOrNull()?.validity() ?: 0) +
12091207
(manager.asKnown().getOrNull()?.validity() ?: 0) +
12101208
(if (middleName.asKnown().isPresent) 1 else 0) +
1211-
(if (sourceId.asKnown().isPresent) 1 else 0) +
12121209
(if (startDate.asKnown().isPresent) 1 else 0) +
12131210
(if (title.asKnown().isPresent) 1 else 0) +
12141211
(if (workId.asKnown().isPresent) 1 else 0) +
12151212
(income.asKnown().getOrNull()?.validity() ?: 0) +
1216-
(incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0)
1213+
(incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
1214+
?: 0) +
1215+
(if (sourceId.asKnown().isPresent) 1 else 0)
12171216

12181217
class CustomField
12191218
private constructor(
@@ -2637,17 +2636,17 @@ private constructor(
26372636
return true
26382637
}
26392638

2640-
return /* spotless:off */ other is UnionMember0 && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && workId == other.workId && income == other.income && incomeHistory == other.incomeHistory && additionalProperties == other.additionalProperties /* spotless:on */
2639+
return /* spotless:off */ other is UnionMember0 && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && startDate == other.startDate && title == other.title && workId == other.workId && income == other.income && incomeHistory == other.incomeHistory && sourceId == other.sourceId && additionalProperties == other.additionalProperties /* spotless:on */
26412640
}
26422641

26432642
/* spotless:off */
2644-
private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, workId, income, incomeHistory, additionalProperties) }
2643+
private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, isActive, lastName, latestRehireDate, location, manager, middleName, startDate, title, workId, income, incomeHistory, sourceId, additionalProperties) }
26452644
/* spotless:on */
26462645

26472646
override fun hashCode(): Int = hashCode
26482647

26492648
override fun toString() =
2650-
"UnionMember0{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, workId=$workId, income=$income, incomeHistory=$incomeHistory, additionalProperties=$additionalProperties}"
2649+
"UnionMember0{id=$id, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, startDate=$startDate, title=$title, workId=$workId, income=$income, incomeHistory=$incomeHistory, sourceId=$sourceId, additionalProperties=$additionalProperties}"
26512650
}
26522651

26532652
class BatchError

finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ internal class EmploymentDataResponseTest {
5656
.build()
5757
)
5858
.middleName("middle_name")
59-
.sourceId("source_id")
6059
.startDate("start_date")
6160
.title("title")
6261
.workId("work_id")
@@ -76,6 +75,7 @@ internal class EmploymentDataResponseTest {
7675
.unit(Income.Unit.YEARLY)
7776
.build()
7877
)
78+
.sourceId("source_id")
7979
.build()
8080
)
8181
.code(0L)
@@ -127,7 +127,6 @@ internal class EmploymentDataResponseTest {
127127
.build()
128128
)
129129
.middleName("middle_name")
130-
.sourceId("source_id")
131130
.startDate("start_date")
132131
.title("title")
133132
.workId("work_id")
@@ -147,6 +146,7 @@ internal class EmploymentDataResponseTest {
147146
.unit(Income.Unit.YEARLY)
148147
.build()
149148
)
149+
.sourceId("source_id")
150150
.build()
151151
)
152152
)
@@ -203,7 +203,6 @@ internal class EmploymentDataResponseTest {
203203
.build()
204204
)
205205
.middleName("middle_name")
206-
.sourceId("source_id")
207206
.startDate("start_date")
208207
.title("title")
209208
.workId("work_id")
@@ -223,6 +222,7 @@ internal class EmploymentDataResponseTest {
223222
.unit(Income.Unit.YEARLY)
224223
.build()
225224
)
225+
.sourceId("source_id")
226226
.build()
227227
)
228228
.code(0L)

finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ internal class EmploymentDataTest {
5757
.build()
5858
)
5959
.middleName("middle_name")
60-
.sourceId("source_id")
6160
.startDate("start_date")
6261
.title("title")
6362
.workId("work_id")
@@ -77,6 +76,7 @@ internal class EmploymentDataTest {
7776
.unit(Income.Unit.YEARLY)
7877
.build()
7978
)
79+
.sourceId("source_id")
8080
.build()
8181

8282
val employmentData = EmploymentData.ofUnionMember0(unionMember0)
@@ -132,7 +132,6 @@ internal class EmploymentDataTest {
132132
.build()
133133
)
134134
.middleName("middle_name")
135-
.sourceId("source_id")
136135
.startDate("start_date")
137136
.title("title")
138137
.workId("work_id")
@@ -152,6 +151,7 @@ internal class EmploymentDataTest {
152151
.unit(Income.Unit.YEARLY)
153152
.build()
154153
)
154+
.sourceId("source_id")
155155
.build()
156156
)
157157

finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPageResponseTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
6464
.build()
6565
)
6666
.middleName("middle_name")
67-
.sourceId("source_id")
6867
.startDate("start_date")
6968
.title("title")
7069
.workId("work_id")
@@ -84,6 +83,7 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
8483
.unit(Income.Unit.YEARLY)
8584
.build()
8685
)
86+
.sourceId("source_id")
8787
.build()
8888
)
8989
.code(0L)
@@ -142,7 +142,6 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
142142
.build()
143143
)
144144
.middleName("middle_name")
145-
.sourceId("source_id")
146145
.startDate("start_date")
147146
.title("title")
148147
.workId("work_id")
@@ -162,6 +161,7 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
162161
.unit(Income.Unit.YEARLY)
163162
.build()
164163
)
164+
.sourceId("source_id")
165165
.build()
166166
)
167167
.code(0L)
@@ -226,7 +226,6 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
226226
.build()
227227
)
228228
.middleName("middle_name")
229-
.sourceId("source_id")
230229
.startDate("start_date")
231230
.title("title")
232231
.workId("work_id")
@@ -246,6 +245,7 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
246245
.unit(Income.Unit.YEARLY)
247246
.build()
248247
)
248+
.sourceId("source_id")
249249
.build()
250250
)
251251
.code(0L)

0 commit comments

Comments
 (0)