Skip to content

Commit 41a7518

Browse files
chore(internal): codegen related update (#675)
1 parent 54b7875 commit 41a7518

File tree

200 files changed

+3231
-4402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+3231
-4402
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ constructor(
1818
private val additionalQueryParams: QueryParams,
1919
) {
2020

21+
/** The identifier of the Account to retrieve. */
2122
fun accountId(): String = accountId
2223

24+
/** The moment to query the balance at. If not set, returns the current balances. */
2325
fun atTime(): Optional<OffsetDateTime> = Optional.ofNullable(atTime)
2426

2527
fun _additionalHeaders(): Headers = additionalHeaders

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ constructor(
1818
private val additionalBodyProperties: Map<String, JsonValue>,
1919
) {
2020

21+
/** The identifier of the Account to close. The account must have a zero balance. */
2122
fun accountId(): String = accountId
2223

2324
fun _additionalHeaders(): Headers = additionalHeaders
@@ -27,9 +28,8 @@ constructor(
2728
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties
2829

2930
@JvmSynthetic
30-
internal fun getBody(): Optional<Map<String, JsonValue>> {
31-
return Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
32-
}
31+
internal fun getBody(): Optional<Map<String, JsonValue>> =
32+
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
3333

3434
@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
3535

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

Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,36 @@ import java.util.Optional
1818

1919
class AccountCreateParams
2020
constructor(
21-
private val name: String,
22-
private val entityId: String?,
23-
private val informationalEntityId: String?,
24-
private val programId: String?,
21+
private val body: AccountCreateBody,
2522
private val additionalHeaders: Headers,
2623
private val additionalQueryParams: QueryParams,
27-
private val additionalBodyProperties: Map<String, JsonValue>,
2824
) {
2925

30-
fun name(): String = name
26+
/** The name you choose for the Account. */
27+
fun name(): String = body.name()
3128

32-
fun entityId(): Optional<String> = Optional.ofNullable(entityId)
29+
/** The identifier for the Entity that will own the Account. */
30+
fun entityId(): Optional<String> = body.entityId()
3331

34-
fun informationalEntityId(): Optional<String> = Optional.ofNullable(informationalEntityId)
32+
/**
33+
* The identifier of an Entity that, while not owning the Account, is associated with its
34+
* activity. Its relationship to your group must be `informational`.
35+
*/
36+
fun informationalEntityId(): Optional<String> = body.informationalEntityId()
3537

36-
fun programId(): Optional<String> = Optional.ofNullable(programId)
38+
/**
39+
* The identifier for the Program that this Account falls under. Required if you operate more
40+
* than one Program.
41+
*/
42+
fun programId(): Optional<String> = body.programId()
3743

3844
fun _additionalHeaders(): Headers = additionalHeaders
3945

4046
fun _additionalQueryParams(): QueryParams = additionalQueryParams
4147

42-
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties
43-
44-
@JvmSynthetic
45-
internal fun getBody(): AccountCreateBody {
46-
return AccountCreateBody(
47-
name,
48-
entityId,
49-
informationalEntityId,
50-
programId,
51-
additionalBodyProperties,
52-
)
53-
}
48+
fun _additionalBodyProperties(): Map<String, JsonValue> = body._additionalProperties()
49+
50+
@JvmSynthetic internal fun getBody(): AccountCreateBody = body
5451

5552
@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
5653

@@ -193,44 +190,36 @@ constructor(
193190
@NoAutoDetect
194191
class Builder {
195192

196-
private var name: String? = null
197-
private var entityId: String? = null
198-
private var informationalEntityId: String? = null
199-
private var programId: String? = null
193+
private var body: AccountCreateBody.Builder = AccountCreateBody.builder()
200194
private var additionalHeaders: Headers.Builder = Headers.builder()
201195
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
202-
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()
203196

204197
@JvmSynthetic
205198
internal fun from(accountCreateParams: AccountCreateParams) = apply {
206-
name = accountCreateParams.name
207-
entityId = accountCreateParams.entityId
208-
informationalEntityId = accountCreateParams.informationalEntityId
209-
programId = accountCreateParams.programId
199+
body = accountCreateParams.body.toBuilder()
210200
additionalHeaders = accountCreateParams.additionalHeaders.toBuilder()
211201
additionalQueryParams = accountCreateParams.additionalQueryParams.toBuilder()
212-
additionalBodyProperties = accountCreateParams.additionalBodyProperties.toMutableMap()
213202
}
214203

215204
/** The name you choose for the Account. */
216-
fun name(name: String) = apply { this.name = name }
205+
fun name(name: String) = apply { body.name(name) }
217206

218207
/** The identifier for the Entity that will own the Account. */
219-
fun entityId(entityId: String) = apply { this.entityId = entityId }
208+
fun entityId(entityId: String) = apply { body.entityId(entityId) }
220209

221210
/**
222211
* The identifier of an Entity that, while not owning the Account, is associated with its
223212
* activity. Its relationship to your group must be `informational`.
224213
*/
225214
fun informationalEntityId(informationalEntityId: String) = apply {
226-
this.informationalEntityId = informationalEntityId
215+
body.informationalEntityId(informationalEntityId)
227216
}
228217

229218
/**
230219
* The identifier for the Program that this Account falls under. Required if you operate
231220
* more than one Program.
232221
*/
233-
fun programId(programId: String) = apply { this.programId = programId }
222+
fun programId(programId: String) = apply { body.programId(programId) }
234223

235224
fun additionalHeaders(additionalHeaders: Headers) = apply {
236225
this.additionalHeaders.clear()
@@ -331,36 +320,29 @@ constructor(
331320
}
332321

333322
fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
334-
this.additionalBodyProperties.clear()
335-
putAllAdditionalBodyProperties(additionalBodyProperties)
323+
body.additionalProperties(additionalBodyProperties)
336324
}
337325

338326
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
339-
additionalBodyProperties.put(key, value)
327+
body.putAdditionalProperty(key, value)
340328
}
341329

342330
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
343331
apply {
344-
this.additionalBodyProperties.putAll(additionalBodyProperties)
332+
body.putAllAdditionalProperties(additionalBodyProperties)
345333
}
346334

347-
fun removeAdditionalBodyProperty(key: String) = apply {
348-
additionalBodyProperties.remove(key)
349-
}
335+
fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
350336

351337
fun removeAllAdditionalBodyProperties(keys: Set<String>) = apply {
352-
keys.forEach(::removeAdditionalBodyProperty)
338+
body.removeAllAdditionalProperties(keys)
353339
}
354340

355341
fun build(): AccountCreateParams =
356342
AccountCreateParams(
357-
checkNotNull(name) { "`name` is required but was not set" },
358-
entityId,
359-
informationalEntityId,
360-
programId,
343+
body.build(),
361344
additionalHeaders.build(),
362345
additionalQueryParams.build(),
363-
additionalBodyProperties.toImmutable(),
364346
)
365347
}
366348

@@ -369,11 +351,11 @@ constructor(
369351
return true
370352
}
371353

372-
return /* spotless:off */ other is AccountCreateParams && name == other.name && entityId == other.entityId && informationalEntityId == other.informationalEntityId && programId == other.programId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
354+
return /* spotless:off */ other is AccountCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
373355
}
374356

375-
override fun hashCode(): Int = /* spotless:off */ Objects.hash(name, entityId, informationalEntityId, programId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
357+
override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */
376358

377359
override fun toString() =
378-
"AccountCreateParams{name=$name, entityId=$entityId, informationalEntityId=$informationalEntityId, programId=$programId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
360+
"AccountCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
379361
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,29 @@ constructor(
3030

3131
fun createdAt(): Optional<CreatedAt> = Optional.ofNullable(createdAt)
3232

33+
/** Return the page of entries after this one. */
3334
fun cursor(): Optional<String> = Optional.ofNullable(cursor)
3435

36+
/** Filter Accounts for those belonging to the specified Entity. */
3537
fun entityId(): Optional<String> = Optional.ofNullable(entityId)
3638

39+
/**
40+
* Filter records to the one with the specified `idempotency_key` you chose for that object.
41+
* This value is unique across Increase and is used to ensure that a request is only processed
42+
* once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
43+
*/
3744
fun idempotencyKey(): Optional<String> = Optional.ofNullable(idempotencyKey)
3845

46+
/** Filter Accounts for those belonging to the specified Entity as informational. */
3947
fun informationalEntityId(): Optional<String> = Optional.ofNullable(informationalEntityId)
4048

49+
/** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */
4150
fun limit(): Optional<Long> = Optional.ofNullable(limit)
4251

52+
/** Filter Accounts for those in a specific Program. */
4353
fun programId(): Optional<String> = Optional.ofNullable(programId)
4454

55+
/** Filter Accounts for those with the specified status. */
4556
fun status(): Optional<Status> = Optional.ofNullable(status)
4657

4758
fun _additionalHeaders(): Headers = additionalHeaders

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

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,30 @@ import java.util.Optional
2121

2222
class AccountNumberCreateParams
2323
constructor(
24-
private val accountId: String,
25-
private val name: String,
26-
private val inboundAch: InboundAch?,
27-
private val inboundChecks: InboundChecks?,
24+
private val body: AccountNumberCreateBody,
2825
private val additionalHeaders: Headers,
2926
private val additionalQueryParams: QueryParams,
30-
private val additionalBodyProperties: Map<String, JsonValue>,
3127
) {
3228

33-
fun accountId(): String = accountId
29+
/** The Account the Account Number should belong to. */
30+
fun accountId(): String = body.accountId()
3431

35-
fun name(): String = name
32+
/** The name you choose for the Account Number. */
33+
fun name(): String = body.name()
3634

37-
fun inboundAch(): Optional<InboundAch> = Optional.ofNullable(inboundAch)
35+
/** Options related to how this Account Number should handle inbound ACH transfers. */
36+
fun inboundAch(): Optional<InboundAch> = body.inboundAch()
3837

39-
fun inboundChecks(): Optional<InboundChecks> = Optional.ofNullable(inboundChecks)
38+
/** Options related to how this Account Number should handle inbound check withdrawals. */
39+
fun inboundChecks(): Optional<InboundChecks> = body.inboundChecks()
4040

4141
fun _additionalHeaders(): Headers = additionalHeaders
4242

4343
fun _additionalQueryParams(): QueryParams = additionalQueryParams
4444

45-
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties
46-
47-
@JvmSynthetic
48-
internal fun getBody(): AccountNumberCreateBody {
49-
return AccountNumberCreateBody(
50-
accountId,
51-
name,
52-
inboundAch,
53-
inboundChecks,
54-
additionalBodyProperties,
55-
)
56-
}
45+
fun _additionalBodyProperties(): Map<String, JsonValue> = body._additionalProperties()
46+
47+
@JvmSynthetic internal fun getBody(): AccountNumberCreateBody = body
5748

5849
@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
5950

@@ -186,38 +177,29 @@ constructor(
186177
@NoAutoDetect
187178
class Builder {
188179

189-
private var accountId: String? = null
190-
private var name: String? = null
191-
private var inboundAch: InboundAch? = null
192-
private var inboundChecks: InboundChecks? = null
180+
private var body: AccountNumberCreateBody.Builder = AccountNumberCreateBody.builder()
193181
private var additionalHeaders: Headers.Builder = Headers.builder()
194182
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
195-
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()
196183

197184
@JvmSynthetic
198185
internal fun from(accountNumberCreateParams: AccountNumberCreateParams) = apply {
199-
accountId = accountNumberCreateParams.accountId
200-
name = accountNumberCreateParams.name
201-
inboundAch = accountNumberCreateParams.inboundAch
202-
inboundChecks = accountNumberCreateParams.inboundChecks
186+
body = accountNumberCreateParams.body.toBuilder()
203187
additionalHeaders = accountNumberCreateParams.additionalHeaders.toBuilder()
204188
additionalQueryParams = accountNumberCreateParams.additionalQueryParams.toBuilder()
205-
additionalBodyProperties =
206-
accountNumberCreateParams.additionalBodyProperties.toMutableMap()
207189
}
208190

209191
/** The Account the Account Number should belong to. */
210-
fun accountId(accountId: String) = apply { this.accountId = accountId }
192+
fun accountId(accountId: String) = apply { body.accountId(accountId) }
211193

212194
/** The name you choose for the Account Number. */
213-
fun name(name: String) = apply { this.name = name }
195+
fun name(name: String) = apply { body.name(name) }
214196

215197
/** Options related to how this Account Number should handle inbound ACH transfers. */
216-
fun inboundAch(inboundAch: InboundAch) = apply { this.inboundAch = inboundAch }
198+
fun inboundAch(inboundAch: InboundAch) = apply { body.inboundAch(inboundAch) }
217199

218200
/** Options related to how this Account Number should handle inbound check withdrawals. */
219201
fun inboundChecks(inboundChecks: InboundChecks) = apply {
220-
this.inboundChecks = inboundChecks
202+
body.inboundChecks(inboundChecks)
221203
}
222204

223205
fun additionalHeaders(additionalHeaders: Headers) = apply {
@@ -319,36 +301,29 @@ constructor(
319301
}
320302

321303
fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
322-
this.additionalBodyProperties.clear()
323-
putAllAdditionalBodyProperties(additionalBodyProperties)
304+
body.additionalProperties(additionalBodyProperties)
324305
}
325306

326307
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
327-
additionalBodyProperties.put(key, value)
308+
body.putAdditionalProperty(key, value)
328309
}
329310

330311
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
331312
apply {
332-
this.additionalBodyProperties.putAll(additionalBodyProperties)
313+
body.putAllAdditionalProperties(additionalBodyProperties)
333314
}
334315

335-
fun removeAdditionalBodyProperty(key: String) = apply {
336-
additionalBodyProperties.remove(key)
337-
}
316+
fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
338317

339318
fun removeAllAdditionalBodyProperties(keys: Set<String>) = apply {
340-
keys.forEach(::removeAdditionalBodyProperty)
319+
body.removeAllAdditionalProperties(keys)
341320
}
342321

343322
fun build(): AccountNumberCreateParams =
344323
AccountNumberCreateParams(
345-
checkNotNull(accountId) { "`accountId` is required but was not set" },
346-
checkNotNull(name) { "`name` is required but was not set" },
347-
inboundAch,
348-
inboundChecks,
324+
body.build(),
349325
additionalHeaders.build(),
350326
additionalQueryParams.build(),
351-
additionalBodyProperties.toImmutable(),
352327
)
353328
}
354329

@@ -649,11 +624,11 @@ constructor(
649624
return true
650625
}
651626

652-
return /* spotless:off */ other is AccountNumberCreateParams && accountId == other.accountId && name == other.name && inboundAch == other.inboundAch && inboundChecks == other.inboundChecks && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
627+
return /* spotless:off */ other is AccountNumberCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
653628
}
654629

655-
override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountId, name, inboundAch, inboundChecks, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
630+
override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */
656631

657632
override fun toString() =
658-
"AccountNumberCreateParams{accountId=$accountId, name=$name, inboundAch=$inboundAch, inboundChecks=$inboundChecks, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
633+
"AccountNumberCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
659634
}

0 commit comments

Comments
 (0)