Skip to content

Commit 4c6ba89

Browse files
feat(api): api update (#739)
1 parent 9df3ea2 commit 4c6ba89

File tree

4 files changed

+53
-50
lines changed

4 files changed

+53
-50
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 201
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-acd347798fc268a8063bde83e83ff69541a1feb789e40bc54b3798937a7492ca.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-503b3369995201c52ca638ced198ae20c73a0b26e5db67b8963e107bff5d1c2d.yml

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

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ private constructor(
3636
/** The transfer amount in USD cents. */
3737
fun amount(): Long = body.amount()
3838

39+
/** Whether Increase will print and mail the check or if you will do it yourself. */
40+
fun fulfillmentMethod(): FulfillmentMethod = body.fulfillmentMethod()
41+
3942
/**
4043
* The identifier of the Account Number from which to send the transfer and print on the check.
4144
*/
4245
fun sourceAccountNumberId(): String = body.sourceAccountNumberId()
4346

44-
/** Whether Increase will print and mail the check or if you will do it yourself. */
45-
fun fulfillmentMethod(): Optional<FulfillmentMethod> = body.fulfillmentMethod()
46-
4747
/**
4848
* Details relating to the physical check that Increase will print and mail. This is required if
4949
* `fulfillment_method` is equal to `physical_check`. It must not be included if any other
@@ -67,14 +67,14 @@ private constructor(
6767
/** The transfer amount in USD cents. */
6868
fun _amount(): JsonField<Long> = body._amount()
6969

70+
/** Whether Increase will print and mail the check or if you will do it yourself. */
71+
fun _fulfillmentMethod(): JsonField<FulfillmentMethod> = body._fulfillmentMethod()
72+
7073
/**
7174
* The identifier of the Account Number from which to send the transfer and print on the check.
7275
*/
7376
fun _sourceAccountNumberId(): JsonField<String> = body._sourceAccountNumberId()
7477

75-
/** Whether Increase will print and mail the check or if you will do it yourself. */
76-
fun _fulfillmentMethod(): JsonField<FulfillmentMethod> = body._fulfillmentMethod()
77-
7878
/**
7979
* Details relating to the physical check that Increase will print and mail. This is required if
8080
* `fulfillment_method` is equal to `physical_check`. It must not be included if any other
@@ -114,12 +114,12 @@ private constructor(
114114
@JsonProperty("amount")
115115
@ExcludeMissing
116116
private val amount: JsonField<Long> = JsonMissing.of(),
117-
@JsonProperty("source_account_number_id")
118-
@ExcludeMissing
119-
private val sourceAccountNumberId: JsonField<String> = JsonMissing.of(),
120117
@JsonProperty("fulfillment_method")
121118
@ExcludeMissing
122119
private val fulfillmentMethod: JsonField<FulfillmentMethod> = JsonMissing.of(),
120+
@JsonProperty("source_account_number_id")
121+
@ExcludeMissing
122+
private val sourceAccountNumberId: JsonField<String> = JsonMissing.of(),
123123
@JsonProperty("physical_check")
124124
@ExcludeMissing
125125
private val physicalCheck: JsonField<PhysicalCheck> = JsonMissing.of(),
@@ -139,17 +139,17 @@ private constructor(
139139
/** The transfer amount in USD cents. */
140140
fun amount(): Long = amount.getRequired("amount")
141141

142+
/** Whether Increase will print and mail the check or if you will do it yourself. */
143+
fun fulfillmentMethod(): FulfillmentMethod =
144+
fulfillmentMethod.getRequired("fulfillment_method")
145+
142146
/**
143147
* The identifier of the Account Number from which to send the transfer and print on the
144148
* check.
145149
*/
146150
fun sourceAccountNumberId(): String =
147151
sourceAccountNumberId.getRequired("source_account_number_id")
148152

149-
/** Whether Increase will print and mail the check or if you will do it yourself. */
150-
fun fulfillmentMethod(): Optional<FulfillmentMethod> =
151-
Optional.ofNullable(fulfillmentMethod.getNullable("fulfillment_method"))
152-
153153
/**
154154
* Details relating to the physical check that Increase will print and mail. This is
155155
* required if `fulfillment_method` is equal to `physical_check`. It must not be included if
@@ -176,6 +176,11 @@ private constructor(
176176
/** The transfer amount in USD cents. */
177177
@JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField<Long> = amount
178178

179+
/** Whether Increase will print and mail the check or if you will do it yourself. */
180+
@JsonProperty("fulfillment_method")
181+
@ExcludeMissing
182+
fun _fulfillmentMethod(): JsonField<FulfillmentMethod> = fulfillmentMethod
183+
179184
/**
180185
* The identifier of the Account Number from which to send the transfer and print on the
181186
* check.
@@ -184,11 +189,6 @@ private constructor(
184189
@ExcludeMissing
185190
fun _sourceAccountNumberId(): JsonField<String> = sourceAccountNumberId
186191

187-
/** Whether Increase will print and mail the check or if you will do it yourself. */
188-
@JsonProperty("fulfillment_method")
189-
@ExcludeMissing
190-
fun _fulfillmentMethod(): JsonField<FulfillmentMethod> = fulfillmentMethod
191-
192192
/**
193193
* Details relating to the physical check that Increase will print and mail. This is
194194
* required if `fulfillment_method` is equal to `physical_check`. It must not be included if
@@ -225,8 +225,8 @@ private constructor(
225225

226226
accountId()
227227
amount()
228-
sourceAccountNumberId()
229228
fulfillmentMethod()
229+
sourceAccountNumberId()
230230
physicalCheck().ifPresent { it.validate() }
231231
requireApproval()
232232
thirdParty().ifPresent { it.validate() }
@@ -245,8 +245,8 @@ private constructor(
245245

246246
private var accountId: JsonField<String>? = null
247247
private var amount: JsonField<Long>? = null
248+
private var fulfillmentMethod: JsonField<FulfillmentMethod>? = null
248249
private var sourceAccountNumberId: JsonField<String>? = null
249-
private var fulfillmentMethod: JsonField<FulfillmentMethod> = JsonMissing.of()
250250
private var physicalCheck: JsonField<PhysicalCheck> = JsonMissing.of()
251251
private var requireApproval: JsonField<Boolean> = JsonMissing.of()
252252
private var thirdParty: JsonField<ThirdParty> = JsonMissing.of()
@@ -256,8 +256,8 @@ private constructor(
256256
internal fun from(checkTransferCreateBody: CheckTransferCreateBody) = apply {
257257
accountId = checkTransferCreateBody.accountId
258258
amount = checkTransferCreateBody.amount
259-
sourceAccountNumberId = checkTransferCreateBody.sourceAccountNumberId
260259
fulfillmentMethod = checkTransferCreateBody.fulfillmentMethod
260+
sourceAccountNumberId = checkTransferCreateBody.sourceAccountNumberId
261261
physicalCheck = checkTransferCreateBody.physicalCheck
262262
requireApproval = checkTransferCreateBody.requireApproval
263263
thirdParty = checkTransferCreateBody.thirdParty
@@ -276,6 +276,15 @@ private constructor(
276276
/** The transfer amount in USD cents. */
277277
fun amount(amount: JsonField<Long>) = apply { this.amount = amount }
278278

279+
/** Whether Increase will print and mail the check or if you will do it yourself. */
280+
fun fulfillmentMethod(fulfillmentMethod: FulfillmentMethod) =
281+
fulfillmentMethod(JsonField.of(fulfillmentMethod))
282+
283+
/** Whether Increase will print and mail the check or if you will do it yourself. */
284+
fun fulfillmentMethod(fulfillmentMethod: JsonField<FulfillmentMethod>) = apply {
285+
this.fulfillmentMethod = fulfillmentMethod
286+
}
287+
279288
/**
280289
* The identifier of the Account Number from which to send the transfer and print on the
281290
* check.
@@ -291,15 +300,6 @@ private constructor(
291300
this.sourceAccountNumberId = sourceAccountNumberId
292301
}
293302

294-
/** Whether Increase will print and mail the check or if you will do it yourself. */
295-
fun fulfillmentMethod(fulfillmentMethod: FulfillmentMethod) =
296-
fulfillmentMethod(JsonField.of(fulfillmentMethod))
297-
298-
/** Whether Increase will print and mail the check or if you will do it yourself. */
299-
fun fulfillmentMethod(fulfillmentMethod: JsonField<FulfillmentMethod>) = apply {
300-
this.fulfillmentMethod = fulfillmentMethod
301-
}
302-
303303
/**
304304
* Details relating to the physical check that Increase will print and mail. This is
305305
* required if `fulfillment_method` is equal to `physical_check`. It must not be
@@ -365,8 +365,8 @@ private constructor(
365365
CheckTransferCreateBody(
366366
checkRequired("accountId", accountId),
367367
checkRequired("amount", amount),
368+
checkRequired("fulfillmentMethod", fulfillmentMethod),
368369
checkRequired("sourceAccountNumberId", sourceAccountNumberId),
369-
fulfillmentMethod,
370370
physicalCheck,
371371
requireApproval,
372372
thirdParty,
@@ -379,17 +379,17 @@ private constructor(
379379
return true
380380
}
381381

382-
return /* spotless:off */ other is CheckTransferCreateBody && accountId == other.accountId && amount == other.amount && sourceAccountNumberId == other.sourceAccountNumberId && fulfillmentMethod == other.fulfillmentMethod && physicalCheck == other.physicalCheck && requireApproval == other.requireApproval && thirdParty == other.thirdParty && additionalProperties == other.additionalProperties /* spotless:on */
382+
return /* spotless:off */ other is CheckTransferCreateBody && accountId == other.accountId && amount == other.amount && fulfillmentMethod == other.fulfillmentMethod && sourceAccountNumberId == other.sourceAccountNumberId && physicalCheck == other.physicalCheck && requireApproval == other.requireApproval && thirdParty == other.thirdParty && additionalProperties == other.additionalProperties /* spotless:on */
383383
}
384384

385385
/* spotless:off */
386-
private val hashCode: Int by lazy { Objects.hash(accountId, amount, sourceAccountNumberId, fulfillmentMethod, physicalCheck, requireApproval, thirdParty, additionalProperties) }
386+
private val hashCode: Int by lazy { Objects.hash(accountId, amount, fulfillmentMethod, sourceAccountNumberId, physicalCheck, requireApproval, thirdParty, additionalProperties) }
387387
/* spotless:on */
388388

389389
override fun hashCode(): Int = hashCode
390390

391391
override fun toString() =
392-
"CheckTransferCreateBody{accountId=$accountId, amount=$amount, sourceAccountNumberId=$sourceAccountNumberId, fulfillmentMethod=$fulfillmentMethod, physicalCheck=$physicalCheck, requireApproval=$requireApproval, thirdParty=$thirdParty, additionalProperties=$additionalProperties}"
392+
"CheckTransferCreateBody{accountId=$accountId, amount=$amount, fulfillmentMethod=$fulfillmentMethod, sourceAccountNumberId=$sourceAccountNumberId, physicalCheck=$physicalCheck, requireApproval=$requireApproval, thirdParty=$thirdParty, additionalProperties=$additionalProperties}"
393393
}
394394

395395
fun toBuilder() = Builder().from(this)
@@ -426,6 +426,16 @@ private constructor(
426426
/** The transfer amount in USD cents. */
427427
fun amount(amount: JsonField<Long>) = apply { body.amount(amount) }
428428

429+
/** Whether Increase will print and mail the check or if you will do it yourself. */
430+
fun fulfillmentMethod(fulfillmentMethod: FulfillmentMethod) = apply {
431+
body.fulfillmentMethod(fulfillmentMethod)
432+
}
433+
434+
/** Whether Increase will print and mail the check or if you will do it yourself. */
435+
fun fulfillmentMethod(fulfillmentMethod: JsonField<FulfillmentMethod>) = apply {
436+
body.fulfillmentMethod(fulfillmentMethod)
437+
}
438+
429439
/**
430440
* The identifier of the Account Number from which to send the transfer and print on the
431441
* check.
@@ -442,16 +452,6 @@ private constructor(
442452
body.sourceAccountNumberId(sourceAccountNumberId)
443453
}
444454

445-
/** Whether Increase will print and mail the check or if you will do it yourself. */
446-
fun fulfillmentMethod(fulfillmentMethod: FulfillmentMethod) = apply {
447-
body.fulfillmentMethod(fulfillmentMethod)
448-
}
449-
450-
/** Whether Increase will print and mail the check or if you will do it yourself. */
451-
fun fulfillmentMethod(fulfillmentMethod: JsonField<FulfillmentMethod>) = apply {
452-
body.fulfillmentMethod(fulfillmentMethod)
453-
}
454-
455455
/**
456456
* Details relating to the physical check that Increase will print and mail. This is
457457
* required if `fulfillment_method` is equal to `physical_check`. It must not be included if

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class CheckTransferCreateParamsTest {
1212
CheckTransferCreateParams.builder()
1313
.accountId("account_in71c4amph0vgo2qllky")
1414
.amount(1000L)
15-
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
1615
.fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
16+
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
1717
.physicalCheck(
1818
CheckTransferCreateParams.PhysicalCheck.builder()
1919
.mailingAddress(
@@ -53,8 +53,8 @@ class CheckTransferCreateParamsTest {
5353
CheckTransferCreateParams.builder()
5454
.accountId("account_in71c4amph0vgo2qllky")
5555
.amount(1000L)
56-
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
5756
.fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
57+
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
5858
.physicalCheck(
5959
CheckTransferCreateParams.PhysicalCheck.builder()
6060
.mailingAddress(
@@ -90,9 +90,9 @@ class CheckTransferCreateParamsTest {
9090
assertThat(body).isNotNull
9191
assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky")
9292
assertThat(body.amount()).isEqualTo(1000L)
93-
assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2")
9493
assertThat(body.fulfillmentMethod())
95-
.contains(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
94+
.isEqualTo(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
95+
assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2")
9696
assertThat(body.physicalCheck())
9797
.contains(
9898
CheckTransferCreateParams.PhysicalCheck.builder()
@@ -133,12 +133,15 @@ class CheckTransferCreateParamsTest {
133133
CheckTransferCreateParams.builder()
134134
.accountId("account_in71c4amph0vgo2qllky")
135135
.amount(1000L)
136+
.fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
136137
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
137138
.build()
138139
val body = params._body()
139140
assertThat(body).isNotNull
140141
assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky")
141142
assertThat(body.amount()).isEqualTo(1000L)
143+
assertThat(body.fulfillmentMethod())
144+
.isEqualTo(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
142145
assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2")
143146
}
144147
}

increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class CheckTransferServiceTest {
2929
CheckTransferCreateParams.builder()
3030
.accountId("account_in71c4amph0vgo2qllky")
3131
.amount(1000L)
32-
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
3332
.fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK)
33+
.sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2")
3434
.physicalCheck(
3535
CheckTransferCreateParams.PhysicalCheck.builder()
3636
.mailingAddress(

0 commit comments

Comments
 (0)