Skip to content

Commit c8a40a2

Browse files
feat(api): api update
1 parent 5b93ab7 commit c8a40a2

File tree

7 files changed

+108
-74
lines changed

7 files changed

+108
-74
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: 232
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-994727afca8b769c05b3531b0e560cfc71b7d2c45a49b54e09bbf73d0dbcaa1f.yml
3-
openapi_spec_hash: bb1c55d7e08fb038a7383976bba226d1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-46a90f99726aa861d06ec56fb73592b4dcb4499d5a765d1a10dfc9619446306f.yml
3+
openapi_spec_hash: 8406b96c39c72de064a810c393c00554
44
config_hash: 27e44ed36b9c5617b580ead7231a594a

increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusion.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ private constructor(
8787
/**
8888
* The name of the excluded institution.
8989
*
90-
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
91-
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
90+
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
91+
* server responded with an unexpected value).
9292
*/
93-
fun bankName(): String = bankName.getRequired("bank_name")
93+
fun bankName(): Optional<String> = bankName.getOptional("bank_name")
9494

9595
/**
9696
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the exclusion
@@ -318,7 +318,10 @@ private constructor(
318318
fun id(id: JsonField<String>) = apply { this.id = id }
319319

320320
/** The name of the excluded institution. */
321-
fun bankName(bankName: String) = bankName(JsonField.of(bankName))
321+
fun bankName(bankName: String?) = bankName(JsonField.ofNullable(bankName))
322+
323+
/** Alias for calling [Builder.bankName] with `bankName.orElse(null)`. */
324+
fun bankName(bankName: Optional<String>) = bankName(bankName.getOrNull())
322325

323326
/**
324327
* Sets [Builder.bankName] to an arbitrary JSON value.

increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionCreateParams.kt

Lines changed: 93 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,38 @@ private constructor(
2727
) : Params {
2828

2929
/**
30-
* The name of the financial institution to be excluded.
30+
* The identifier of the Entity whose deposits will be excluded.
3131
*
3232
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
3333
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
3434
*/
35-
fun bankName(): String = body.bankName()
35+
fun entityId(): String = body.entityId()
3636

3737
/**
38-
* The identifier of the Entity whose deposits will be excluded.
38+
* The FDIC certificate number of the financial institution to be excluded. An FDIC certificate
39+
* number uniquely identifies a financial institution, and is different than a routing number.
40+
* To find one, we recommend searching by Bank Name using the
41+
* [FDIC's bankfind tool](https://banks.data.fdic.gov/bankfind-suite/bankfind).
3942
*
4043
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
4144
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
4245
*/
43-
fun entityId(): String = body.entityId()
46+
fun fdicCertificateNumber(): String = body.fdicCertificateNumber()
4447

4548
/**
46-
* Returns the raw JSON value of [bankName].
49+
* Returns the raw JSON value of [entityId].
4750
*
48-
* Unlike [bankName], this method doesn't throw if the JSON field has an unexpected type.
51+
* Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
4952
*/
50-
fun _bankName(): JsonField<String> = body._bankName()
53+
fun _entityId(): JsonField<String> = body._entityId()
5154

5255
/**
53-
* Returns the raw JSON value of [entityId].
56+
* Returns the raw JSON value of [fdicCertificateNumber].
5457
*
55-
* Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
58+
* Unlike [fdicCertificateNumber], this method doesn't throw if the JSON field has an unexpected
59+
* type.
5660
*/
57-
fun _entityId(): JsonField<String> = body._entityId()
61+
fun _fdicCertificateNumber(): JsonField<String> = body._fdicCertificateNumber()
5862

5963
fun _additionalBodyProperties(): Map<String, JsonValue> = body._additionalProperties()
6064

@@ -73,8 +77,8 @@ private constructor(
7377
*
7478
* The following fields are required:
7579
* ```java
76-
* .bankName()
7780
* .entityId()
81+
* .fdicCertificateNumber()
7882
* ```
7983
*/
8084
@JvmStatic fun builder() = Builder()
@@ -99,22 +103,11 @@ private constructor(
99103
*
100104
* This is generally only useful if you are already constructing the body separately.
101105
* Otherwise, it's more convenient to use the top-level setters instead:
102-
* - [bankName]
103106
* - [entityId]
107+
* - [fdicCertificateNumber]
104108
*/
105109
fun body(body: Body) = apply { this.body = body.toBuilder() }
106110

107-
/** The name of the financial institution to be excluded. */
108-
fun bankName(bankName: String) = apply { body.bankName(bankName) }
109-
110-
/**
111-
* Sets [Builder.bankName] to an arbitrary JSON value.
112-
*
113-
* You should usually call [Builder.bankName] with a well-typed [String] value instead. This
114-
* method is primarily for setting the field to an undocumented or not yet supported value.
115-
*/
116-
fun bankName(bankName: JsonField<String>) = apply { body.bankName(bankName) }
117-
118111
/** The identifier of the Entity whose deposits will be excluded. */
119112
fun entityId(entityId: String) = apply { body.entityId(entityId) }
120113

@@ -126,6 +119,27 @@ private constructor(
126119
*/
127120
fun entityId(entityId: JsonField<String>) = apply { body.entityId(entityId) }
128121

122+
/**
123+
* The FDIC certificate number of the financial institution to be excluded. An FDIC
124+
* certificate number uniquely identifies a financial institution, and is different than a
125+
* routing number. To find one, we recommend searching by Bank Name using the
126+
* [FDIC's bankfind tool](https://banks.data.fdic.gov/bankfind-suite/bankfind).
127+
*/
128+
fun fdicCertificateNumber(fdicCertificateNumber: String) = apply {
129+
body.fdicCertificateNumber(fdicCertificateNumber)
130+
}
131+
132+
/**
133+
* Sets [Builder.fdicCertificateNumber] to an arbitrary JSON value.
134+
*
135+
* You should usually call [Builder.fdicCertificateNumber] with a well-typed [String] value
136+
* instead. This method is primarily for setting the field to an undocumented or not yet
137+
* supported value.
138+
*/
139+
fun fdicCertificateNumber(fdicCertificateNumber: JsonField<String>) = apply {
140+
body.fdicCertificateNumber(fdicCertificateNumber)
141+
}
142+
129143
fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
130144
body.additionalProperties(additionalBodyProperties)
131145
}
@@ -250,8 +264,8 @@ private constructor(
250264
*
251265
* The following fields are required:
252266
* ```java
253-
* .bankName()
254267
* .entityId()
268+
* .fdicCertificateNumber()
255269
* ```
256270
*
257271
* @throws IllegalStateException if any required field is unset.
@@ -273,50 +287,57 @@ private constructor(
273287
class Body
274288
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
275289
private constructor(
276-
private val bankName: JsonField<String>,
277290
private val entityId: JsonField<String>,
291+
private val fdicCertificateNumber: JsonField<String>,
278292
private val additionalProperties: MutableMap<String, JsonValue>,
279293
) {
280294

281295
@JsonCreator
282296
private constructor(
283-
@JsonProperty("bank_name")
284-
@ExcludeMissing
285-
bankName: JsonField<String> = JsonMissing.of(),
286297
@JsonProperty("entity_id")
287298
@ExcludeMissing
288299
entityId: JsonField<String> = JsonMissing.of(),
289-
) : this(bankName, entityId, mutableMapOf())
300+
@JsonProperty("fdic_certificate_number")
301+
@ExcludeMissing
302+
fdicCertificateNumber: JsonField<String> = JsonMissing.of(),
303+
) : this(entityId, fdicCertificateNumber, mutableMapOf())
290304

291305
/**
292-
* The name of the financial institution to be excluded.
306+
* The identifier of the Entity whose deposits will be excluded.
293307
*
294308
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
295309
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
296310
*/
297-
fun bankName(): String = bankName.getRequired("bank_name")
311+
fun entityId(): String = entityId.getRequired("entity_id")
298312

299313
/**
300-
* The identifier of the Entity whose deposits will be excluded.
314+
* The FDIC certificate number of the financial institution to be excluded. An FDIC
315+
* certificate number uniquely identifies a financial institution, and is different than a
316+
* routing number. To find one, we recommend searching by Bank Name using the
317+
* [FDIC's bankfind tool](https://banks.data.fdic.gov/bankfind-suite/bankfind).
301318
*
302319
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
303320
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
304321
*/
305-
fun entityId(): String = entityId.getRequired("entity_id")
322+
fun fdicCertificateNumber(): String =
323+
fdicCertificateNumber.getRequired("fdic_certificate_number")
306324

307325
/**
308-
* Returns the raw JSON value of [bankName].
326+
* Returns the raw JSON value of [entityId].
309327
*
310-
* Unlike [bankName], this method doesn't throw if the JSON field has an unexpected type.
328+
* Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
311329
*/
312-
@JsonProperty("bank_name") @ExcludeMissing fun _bankName(): JsonField<String> = bankName
330+
@JsonProperty("entity_id") @ExcludeMissing fun _entityId(): JsonField<String> = entityId
313331

314332
/**
315-
* Returns the raw JSON value of [entityId].
333+
* Returns the raw JSON value of [fdicCertificateNumber].
316334
*
317-
* Unlike [entityId], this method doesn't throw if the JSON field has an unexpected type.
335+
* Unlike [fdicCertificateNumber], this method doesn't throw if the JSON field has an
336+
* unexpected type.
318337
*/
319-
@JsonProperty("entity_id") @ExcludeMissing fun _entityId(): JsonField<String> = entityId
338+
@JsonProperty("fdic_certificate_number")
339+
@ExcludeMissing
340+
fun _fdicCertificateNumber(): JsonField<String> = fdicCertificateNumber
320341

321342
@JsonAnySetter
322343
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -337,8 +358,8 @@ private constructor(
337358
*
338359
* The following fields are required:
339360
* ```java
340-
* .bankName()
341361
* .entityId()
362+
* .fdicCertificateNumber()
342363
* ```
343364
*/
344365
@JvmStatic fun builder() = Builder()
@@ -347,29 +368,17 @@ private constructor(
347368
/** A builder for [Body]. */
348369
class Builder internal constructor() {
349370

350-
private var bankName: JsonField<String>? = null
351371
private var entityId: JsonField<String>? = null
372+
private var fdicCertificateNumber: JsonField<String>? = null
352373
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
353374

354375
@JvmSynthetic
355376
internal fun from(body: Body) = apply {
356-
bankName = body.bankName
357377
entityId = body.entityId
378+
fdicCertificateNumber = body.fdicCertificateNumber
358379
additionalProperties = body.additionalProperties.toMutableMap()
359380
}
360381

361-
/** The name of the financial institution to be excluded. */
362-
fun bankName(bankName: String) = bankName(JsonField.of(bankName))
363-
364-
/**
365-
* Sets [Builder.bankName] to an arbitrary JSON value.
366-
*
367-
* You should usually call [Builder.bankName] with a well-typed [String] value instead.
368-
* This method is primarily for setting the field to an undocumented or not yet
369-
* supported value.
370-
*/
371-
fun bankName(bankName: JsonField<String>) = apply { this.bankName = bankName }
372-
373382
/** The identifier of the Entity whose deposits will be excluded. */
374383
fun entityId(entityId: String) = entityId(JsonField.of(entityId))
375384

@@ -382,6 +391,26 @@ private constructor(
382391
*/
383392
fun entityId(entityId: JsonField<String>) = apply { this.entityId = entityId }
384393

394+
/**
395+
* The FDIC certificate number of the financial institution to be excluded. An FDIC
396+
* certificate number uniquely identifies a financial institution, and is different than
397+
* a routing number. To find one, we recommend searching by Bank Name using the
398+
* [FDIC's bankfind tool](https://banks.data.fdic.gov/bankfind-suite/bankfind).
399+
*/
400+
fun fdicCertificateNumber(fdicCertificateNumber: String) =
401+
fdicCertificateNumber(JsonField.of(fdicCertificateNumber))
402+
403+
/**
404+
* Sets [Builder.fdicCertificateNumber] to an arbitrary JSON value.
405+
*
406+
* You should usually call [Builder.fdicCertificateNumber] with a well-typed [String]
407+
* value instead. This method is primarily for setting the field to an undocumented or
408+
* not yet supported value.
409+
*/
410+
fun fdicCertificateNumber(fdicCertificateNumber: JsonField<String>) = apply {
411+
this.fdicCertificateNumber = fdicCertificateNumber
412+
}
413+
385414
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
386415
this.additionalProperties.clear()
387416
putAllAdditionalProperties(additionalProperties)
@@ -408,16 +437,16 @@ private constructor(
408437
*
409438
* The following fields are required:
410439
* ```java
411-
* .bankName()
412440
* .entityId()
441+
* .fdicCertificateNumber()
413442
* ```
414443
*
415444
* @throws IllegalStateException if any required field is unset.
416445
*/
417446
fun build(): Body =
418447
Body(
419-
checkRequired("bankName", bankName),
420448
checkRequired("entityId", entityId),
449+
checkRequired("fdicCertificateNumber", fdicCertificateNumber),
421450
additionalProperties.toMutableMap(),
422451
)
423452
}
@@ -429,8 +458,8 @@ private constructor(
429458
return@apply
430459
}
431460

432-
bankName()
433461
entityId()
462+
fdicCertificateNumber()
434463
validated = true
435464
}
436465

@@ -450,26 +479,28 @@ private constructor(
450479
*/
451480
@JvmSynthetic
452481
internal fun validity(): Int =
453-
(if (bankName.asKnown().isPresent) 1 else 0) +
454-
(if (entityId.asKnown().isPresent) 1 else 0)
482+
(if (entityId.asKnown().isPresent) 1 else 0) +
483+
(if (fdicCertificateNumber.asKnown().isPresent) 1 else 0)
455484

456485
override fun equals(other: Any?): Boolean {
457486
if (this === other) {
458487
return true
459488
}
460489

461490
return other is Body &&
462-
bankName == other.bankName &&
463491
entityId == other.entityId &&
492+
fdicCertificateNumber == other.fdicCertificateNumber &&
464493
additionalProperties == other.additionalProperties
465494
}
466495

467-
private val hashCode: Int by lazy { Objects.hash(bankName, entityId, additionalProperties) }
496+
private val hashCode: Int by lazy {
497+
Objects.hash(entityId, fdicCertificateNumber, additionalProperties)
498+
}
468499

469500
override fun hashCode(): Int = hashCode
470501

471502
override fun toString() =
472-
"Body{bankName=$bankName, entityId=$entityId, additionalProperties=$additionalProperties}"
503+
"Body{entityId=$entityId, fdicCertificateNumber=$fdicCertificateNumber, additionalProperties=$additionalProperties}"
473504
}
474505

475506
override fun equals(other: Any?): Boolean {

increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionCreateParamsTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ internal class IntrafiExclusionCreateParamsTest {
1010
@Test
1111
fun create() {
1212
IntrafiExclusionCreateParams.builder()
13-
.bankName("Example Bank")
1413
.entityId("entity_n8y8tnk2p9339ti393yi")
14+
.fdicCertificateNumber("314159")
1515
.build()
1616
}
1717

1818
@Test
1919
fun body() {
2020
val params =
2121
IntrafiExclusionCreateParams.builder()
22-
.bankName("Example Bank")
2322
.entityId("entity_n8y8tnk2p9339ti393yi")
23+
.fdicCertificateNumber("314159")
2424
.build()
2525

2626
val body = params._body()
2727

28-
assertThat(body.bankName()).isEqualTo("Example Bank")
2928
assertThat(body.entityId()).isEqualTo("entity_n8y8tnk2p9339ti393yi")
29+
assertThat(body.fdicCertificateNumber()).isEqualTo("314159")
3030
}
3131
}

increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal class IntrafiExclusionTest {
2727
.build()
2828

2929
assertThat(intrafiExclusion.id()).isEqualTo("intrafi_exclusion_ygfqduuzpau3jqof6jyh")
30-
assertThat(intrafiExclusion.bankName()).isEqualTo("Example Bank")
30+
assertThat(intrafiExclusion.bankName()).contains("Example Bank")
3131
assertThat(intrafiExclusion.createdAt())
3232
.isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
3333
assertThat(intrafiExclusion.entityId()).isEqualTo("entity_n8y8tnk2p9339ti393yi")

0 commit comments

Comments
 (0)