Skip to content

Commit 85f964f

Browse files
feat(api): api update
1 parent ec234c1 commit 85f964f

13 files changed

Lines changed: 70 additions & 58 deletions

.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-1a82d3230c420c8562600b0ad45133d79ab68ffd21d524ab26eef11e163dba09.yml
3-
openapi_spec_hash: 7bd02ce73505e51c5fd78608fed55c62
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-dd2cdf274497a0f36aaa493457a1144f51f6c28e14b4521acca9715747688b50.yml
3+
openapi_spec_hash: 8bbc0ac9dae255055b69c1d040c43c4b
44
config_hash: 5146b12344dae76238940989dac1e8a0

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.tryfinch.api.core.JsonMissing
1313
import com.tryfinch.api.core.JsonValue
1414
import com.tryfinch.api.core.checkRequired
1515
import com.tryfinch.api.errors.FinchInvalidDataException
16+
import java.time.LocalDate
1617
import java.util.Collections
1718
import java.util.Objects
1819
import java.util.Optional
@@ -27,7 +28,7 @@ class Income
2728
private constructor(
2829
private val amount: JsonField<Long>,
2930
private val currency: JsonField<String>,
30-
private val effectiveDate: JsonField<String>,
31+
private val effectiveDate: JsonField<LocalDate>,
3132
private val unit: JsonField<Unit>,
3233
private val additionalProperties: MutableMap<String, JsonValue>,
3334
) {
@@ -38,7 +39,7 @@ private constructor(
3839
@JsonProperty("currency") @ExcludeMissing currency: JsonField<String> = JsonMissing.of(),
3940
@JsonProperty("effective_date")
4041
@ExcludeMissing
41-
effectiveDate: JsonField<String> = JsonMissing.of(),
42+
effectiveDate: JsonField<LocalDate> = JsonMissing.of(),
4243
@JsonProperty("unit") @ExcludeMissing unit: JsonField<Unit> = JsonMissing.of(),
4344
) : this(amount, currency, effectiveDate, unit, mutableMapOf())
4445

@@ -64,7 +65,7 @@ private constructor(
6465
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
6566
* server responded with an unexpected value).
6667
*/
67-
fun effectiveDate(): Optional<String> = effectiveDate.getOptional("effective_date")
68+
fun effectiveDate(): Optional<LocalDate> = effectiveDate.getOptional("effective_date")
6869

6970
/**
7071
* The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`,
@@ -96,7 +97,7 @@ private constructor(
9697
*/
9798
@JsonProperty("effective_date")
9899
@ExcludeMissing
99-
fun _effectiveDate(): JsonField<String> = effectiveDate
100+
fun _effectiveDate(): JsonField<LocalDate> = effectiveDate
100101

101102
/**
102103
* Returns the raw JSON value of [unit].
@@ -138,7 +139,7 @@ private constructor(
138139

139140
private var amount: JsonField<Long>? = null
140141
private var currency: JsonField<String>? = null
141-
private var effectiveDate: JsonField<String>? = null
142+
private var effectiveDate: JsonField<LocalDate>? = null
142143
private var unit: JsonField<Unit>? = null
143144
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
144145

@@ -187,21 +188,21 @@ private constructor(
187188
fun currency(currency: JsonField<String>) = apply { this.currency = currency }
188189

189190
/** The date the income amount went into effect. */
190-
fun effectiveDate(effectiveDate: String?) =
191+
fun effectiveDate(effectiveDate: LocalDate?) =
191192
effectiveDate(JsonField.ofNullable(effectiveDate))
192193

193194
/** Alias for calling [Builder.effectiveDate] with `effectiveDate.orElse(null)`. */
194-
fun effectiveDate(effectiveDate: Optional<String>) =
195+
fun effectiveDate(effectiveDate: Optional<LocalDate>) =
195196
effectiveDate(effectiveDate.getOrNull())
196197

197198
/**
198199
* Sets [Builder.effectiveDate] to an arbitrary JSON value.
199200
*
200-
* You should usually call [Builder.effectiveDate] with a well-typed [String] value instead.
201-
* This method is primarily for setting the field to an undocumented or not yet supported
202-
* value.
201+
* You should usually call [Builder.effectiveDate] with a well-typed [LocalDate] value
202+
* instead. This method is primarily for setting the field to an undocumented or not yet
203+
* supported value.
203204
*/
204-
fun effectiveDate(effectiveDate: JsonField<String>) = apply {
205+
fun effectiveDate(effectiveDate: JsonField<LocalDate>) = apply {
205206
this.effectiveDate = effectiveDate
206207
}
207208

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package com.tryfinch.api.models
44

55
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
66
import com.tryfinch.api.core.jsonMapper
7+
import java.time.LocalDate
78
import org.assertj.core.api.Assertions.assertThat
89
import org.junit.jupiter.api.Test
910

@@ -62,15 +63,15 @@ internal class EmploymentDataResponseTest {
6263
Income.builder()
6364
.amount(0L)
6465
.currency("currency")
65-
.effectiveDate("effective_date")
66+
.effectiveDate(LocalDate.parse("2019-12-27"))
6667
.unit(Income.Unit.YEARLY)
6768
.build()
6869
)
6970
.addIncomeHistory(
7071
Income.builder()
7172
.amount(0L)
7273
.currency("currency")
73-
.effectiveDate("effective_date")
74+
.effectiveDate(LocalDate.parse("2019-12-27"))
7475
.unit(Income.Unit.YEARLY)
7576
.build()
7677
)
@@ -133,15 +134,15 @@ internal class EmploymentDataResponseTest {
133134
Income.builder()
134135
.amount(0L)
135136
.currency("currency")
136-
.effectiveDate("effective_date")
137+
.effectiveDate(LocalDate.parse("2019-12-27"))
137138
.unit(Income.Unit.YEARLY)
138139
.build()
139140
)
140141
.addIncomeHistory(
141142
Income.builder()
142143
.amount(0L)
143144
.currency("currency")
144-
.effectiveDate("effective_date")
145+
.effectiveDate(LocalDate.parse("2019-12-27"))
145146
.unit(Income.Unit.YEARLY)
146147
.build()
147148
)
@@ -209,15 +210,15 @@ internal class EmploymentDataResponseTest {
209210
Income.builder()
210211
.amount(0L)
211212
.currency("currency")
212-
.effectiveDate("effective_date")
213+
.effectiveDate(LocalDate.parse("2019-12-27"))
213214
.unit(Income.Unit.YEARLY)
214215
.build()
215216
)
216217
.addIncomeHistory(
217218
Income.builder()
218219
.amount(0L)
219220
.currency("currency")
220-
.effectiveDate("effective_date")
221+
.effectiveDate(LocalDate.parse("2019-12-27"))
221222
.unit(Income.Unit.YEARLY)
222223
.build()
223224
)

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
66
import com.tryfinch.api.core.JsonValue
77
import com.tryfinch.api.core.jsonMapper
88
import com.tryfinch.api.errors.FinchInvalidDataException
9+
import java.time.LocalDate
910
import org.assertj.core.api.Assertions.assertThat
1011
import org.junit.jupiter.api.Test
1112
import org.junit.jupiter.api.assertThrows
@@ -63,15 +64,15 @@ internal class EmploymentDataTest {
6364
Income.builder()
6465
.amount(0L)
6566
.currency("currency")
66-
.effectiveDate("effective_date")
67+
.effectiveDate(LocalDate.parse("2019-12-27"))
6768
.unit(Income.Unit.YEARLY)
6869
.build()
6970
)
7071
.addIncomeHistory(
7172
Income.builder()
7273
.amount(0L)
7374
.currency("currency")
74-
.effectiveDate("effective_date")
75+
.effectiveDate(LocalDate.parse("2019-12-27"))
7576
.unit(Income.Unit.YEARLY)
7677
.build()
7778
)
@@ -138,15 +139,15 @@ internal class EmploymentDataTest {
138139
Income.builder()
139140
.amount(0L)
140141
.currency("currency")
141-
.effectiveDate("effective_date")
142+
.effectiveDate(LocalDate.parse("2019-12-27"))
142143
.unit(Income.Unit.YEARLY)
143144
.build()
144145
)
145146
.addIncomeHistory(
146147
Income.builder()
147148
.amount(0L)
148149
.currency("currency")
149-
.effectiveDate("effective_date")
150+
.effectiveDate(LocalDate.parse("2019-12-27"))
150151
.unit(Income.Unit.YEARLY)
151152
.build()
152153
)

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package com.tryfinch.api.models
55
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
66
import com.tryfinch.api.core.JsonValue
77
import com.tryfinch.api.core.jsonMapper
8+
import java.time.LocalDate
89
import kotlin.jvm.optionals.getOrNull
910
import org.assertj.core.api.Assertions.assertThat
1011
import org.junit.jupiter.api.Test
@@ -37,15 +38,15 @@ internal class EmploymentUpdateResponseTest {
3738
Income.builder()
3839
.amount(0L)
3940
.currency("currency")
40-
.effectiveDate("effective_date")
41+
.effectiveDate(LocalDate.parse("2019-12-27"))
4142
.unit(Income.Unit.YEARLY)
4243
.build()
4344
)
4445
.addIncomeHistory(
4546
Income.builder()
4647
.amount(0L)
4748
.currency("currency")
48-
.effectiveDate("effective_date")
49+
.effectiveDate(LocalDate.parse("2019-12-27"))
4950
.unit(Income.Unit.YEARLY)
5051
.build()
5152
)
@@ -102,7 +103,7 @@ internal class EmploymentUpdateResponseTest {
102103
Income.builder()
103104
.amount(0L)
104105
.currency("currency")
105-
.effectiveDate("effective_date")
106+
.effectiveDate(LocalDate.parse("2019-12-27"))
106107
.unit(Income.Unit.YEARLY)
107108
.build()
108109
)
@@ -111,7 +112,7 @@ internal class EmploymentUpdateResponseTest {
111112
Income.builder()
112113
.amount(0L)
113114
.currency("currency")
114-
.effectiveDate("effective_date")
115+
.effectiveDate(LocalDate.parse("2019-12-27"))
115116
.unit(Income.Unit.YEARLY)
116117
.build()
117118
)
@@ -170,15 +171,15 @@ internal class EmploymentUpdateResponseTest {
170171
Income.builder()
171172
.amount(0L)
172173
.currency("currency")
173-
.effectiveDate("effective_date")
174+
.effectiveDate(LocalDate.parse("2019-12-27"))
174175
.unit(Income.Unit.YEARLY)
175176
.build()
176177
)
177178
.addIncomeHistory(
178179
Income.builder()
179180
.amount(0L)
180181
.currency("currency")
181-
.effectiveDate("effective_date")
182+
.effectiveDate(LocalDate.parse("2019-12-27"))
182183
.unit(Income.Unit.YEARLY)
183184
.build()
184185
)

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package com.tryfinch.api.models
44

55
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
66
import com.tryfinch.api.core.jsonMapper
7+
import java.time.LocalDate
78
import org.assertj.core.api.Assertions.assertThat
89
import org.junit.jupiter.api.Test
910

@@ -70,15 +71,15 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
7071
Income.builder()
7172
.amount(0L)
7273
.currency("currency")
73-
.effectiveDate("effective_date")
74+
.effectiveDate(LocalDate.parse("2019-12-27"))
7475
.unit(Income.Unit.YEARLY)
7576
.build()
7677
)
7778
.addIncomeHistory(
7879
Income.builder()
7980
.amount(0L)
8081
.currency("currency")
81-
.effectiveDate("effective_date")
82+
.effectiveDate(LocalDate.parse("2019-12-27"))
8283
.unit(Income.Unit.YEARLY)
8384
.build()
8485
)
@@ -148,15 +149,15 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
148149
Income.builder()
149150
.amount(0L)
150151
.currency("currency")
151-
.effectiveDate("effective_date")
152+
.effectiveDate(LocalDate.parse("2019-12-27"))
152153
.unit(Income.Unit.YEARLY)
153154
.build()
154155
)
155156
.addIncomeHistory(
156157
Income.builder()
157158
.amount(0L)
158159
.currency("currency")
159-
.effectiveDate("effective_date")
160+
.effectiveDate(LocalDate.parse("2019-12-27"))
160161
.unit(Income.Unit.YEARLY)
161162
.build()
162163
)
@@ -232,15 +233,15 @@ internal class HrisEmploymentRetrieveManyPageResponseTest {
232233
Income.builder()
233234
.amount(0L)
234235
.currency("currency")
235-
.effectiveDate("effective_date")
236+
.effectiveDate(LocalDate.parse("2019-12-27"))
236237
.unit(Income.Unit.YEARLY)
237238
.build()
238239
)
239240
.addIncomeHistory(
240241
Income.builder()
241242
.amount(0L)
242243
.currency("currency")
243-
.effectiveDate("effective_date")
244+
.effectiveDate(LocalDate.parse("2019-12-27"))
244245
.unit(Income.Unit.YEARLY)
245246
.build()
246247
)

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package com.tryfinch.api.models
44

55
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
66
import com.tryfinch.api.core.jsonMapper
7+
import java.time.LocalDate
78
import org.assertj.core.api.Assertions.assertThat
89
import org.junit.jupiter.api.Test
910

@@ -15,13 +16,13 @@ internal class IncomeTest {
1516
Income.builder()
1617
.amount(0L)
1718
.currency("currency")
18-
.effectiveDate("effective_date")
19+
.effectiveDate(LocalDate.parse("2019-12-27"))
1920
.unit(Income.Unit.YEARLY)
2021
.build()
2122

2223
assertThat(income.amount()).contains(0L)
2324
assertThat(income.currency()).contains("currency")
24-
assertThat(income.effectiveDate()).contains("effective_date")
25+
assertThat(income.effectiveDate()).contains(LocalDate.parse("2019-12-27"))
2526
assertThat(income.unit()).contains(Income.Unit.YEARLY)
2627
}
2728

@@ -32,7 +33,7 @@ internal class IncomeTest {
3233
Income.builder()
3334
.amount(0L)
3435
.currency("currency")
35-
.effectiveDate("effective_date")
36+
.effectiveDate(LocalDate.parse("2019-12-27"))
3637
.unit(Income.Unit.YEARLY)
3738
.build()
3839

0 commit comments

Comments
 (0)