Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 239
openapi_spec_hash: d691eb2845a0108278fe81faa111d29f
openapi_spec_hash: 85e424bee4fe449466ceada88117613e
config_hash: 1ca082e374ef7000e2a5971e8da740e0
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/increase.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ tasks.withType<Test>().configureEach {
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
forkEvery = 100

// Mockito's inline mock maker attaches the Byte Buddy agent dynamically, which makes the
// JVM print a warning to stderr. Tests that capture stderr to assert on logging output run
// concurrently with tests that use Mockito, so that warning can land in their captured
// output and fail them. Enabling dynamic agent loading up front suppresses the warning.
jvmArgs("-XX:+EnableDynamicAgentLoading")

testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,9 @@ private constructor(
private constructor(
private val creditLimit: JsonField<Long>,
private val gracePeriodDays: JsonField<Long>,
private val maturityDate: JsonField<LocalDate>,
private val statementDayOfMonth: JsonField<Long>,
private val statementPaymentType: JsonField<StatementPaymentType>,
private val maturityDate: JsonField<LocalDate>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

Expand All @@ -946,21 +946,21 @@ private constructor(
@JsonProperty("grace_period_days")
@ExcludeMissing
gracePeriodDays: JsonField<Long> = JsonMissing.of(),
@JsonProperty("maturity_date")
@ExcludeMissing
maturityDate: JsonField<LocalDate> = JsonMissing.of(),
@JsonProperty("statement_day_of_month")
@ExcludeMissing
statementDayOfMonth: JsonField<Long> = JsonMissing.of(),
@JsonProperty("statement_payment_type")
@ExcludeMissing
statementPaymentType: JsonField<StatementPaymentType> = JsonMissing.of(),
@JsonProperty("maturity_date")
@ExcludeMissing
maturityDate: JsonField<LocalDate> = JsonMissing.of(),
) : this(
creditLimit,
gracePeriodDays,
maturityDate,
statementDayOfMonth,
statementPaymentType,
maturityDate,
mutableMapOf(),
)

Expand All @@ -976,35 +976,36 @@ private constructor(
* The number of days after the statement date that the Account can be past due before being
* considered delinquent.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun gracePeriodDays(): Long = gracePeriodDays.getRequired("grace_period_days")
fun gracePeriodDays(): Optional<Long> = gracePeriodDays.getOptional("grace_period_days")

/**
* The day of the month on which the loan statement is generated.
* The date on which the loan matures.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun statementDayOfMonth(): Long = statementDayOfMonth.getRequired("statement_day_of_month")
fun maturityDate(): Optional<LocalDate> = maturityDate.getOptional("maturity_date")

/**
* The type of statement payment for the account.
* The day of the month on which the loan statement is generated.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun statementPaymentType(): StatementPaymentType =
statementPaymentType.getRequired("statement_payment_type")
fun statementDayOfMonth(): Optional<Long> =
statementDayOfMonth.getOptional("statement_day_of_month")

/**
* The date on which the loan matures.
* The type of statement payment for the account.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun maturityDate(): Optional<LocalDate> = maturityDate.getOptional("maturity_date")
fun statementPaymentType(): Optional<StatementPaymentType> =
statementPaymentType.getOptional("statement_payment_type")

/**
* Returns the raw JSON value of [creditLimit].
Expand All @@ -1025,6 +1026,16 @@ private constructor(
@ExcludeMissing
fun _gracePeriodDays(): JsonField<Long> = gracePeriodDays

/**
* Returns the raw JSON value of [maturityDate].
*
* Unlike [maturityDate], this method doesn't throw if the JSON field has an unexpected
* type.
*/
@JsonProperty("maturity_date")
@ExcludeMissing
fun _maturityDate(): JsonField<LocalDate> = maturityDate

/**
* Returns the raw JSON value of [statementDayOfMonth].
*
Expand All @@ -1045,16 +1056,6 @@ private constructor(
@ExcludeMissing
fun _statementPaymentType(): JsonField<StatementPaymentType> = statementPaymentType

/**
* Returns the raw JSON value of [maturityDate].
*
* Unlike [maturityDate], this method doesn't throw if the JSON field has an unexpected
* type.
*/
@JsonProperty("maturity_date")
@ExcludeMissing
fun _maturityDate(): JsonField<LocalDate> = maturityDate

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
Expand All @@ -1075,9 +1076,6 @@ private constructor(
* The following fields are required:
* ```java
* .creditLimit()
* .gracePeriodDays()
* .statementDayOfMonth()
* .statementPaymentType()
* ```
*/
@JvmStatic fun builder() = Builder()
Expand All @@ -1087,19 +1085,19 @@ private constructor(
class Builder internal constructor() {

private var creditLimit: JsonField<Long>? = null
private var gracePeriodDays: JsonField<Long>? = null
private var statementDayOfMonth: JsonField<Long>? = null
private var statementPaymentType: JsonField<StatementPaymentType>? = null
private var gracePeriodDays: JsonField<Long> = JsonMissing.of()
private var maturityDate: JsonField<LocalDate> = JsonMissing.of()
private var statementDayOfMonth: JsonField<Long> = JsonMissing.of()
private var statementPaymentType: JsonField<StatementPaymentType> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(loan: Loan) = apply {
creditLimit = loan.creditLimit
gracePeriodDays = loan.gracePeriodDays
maturityDate = loan.maturityDate
statementDayOfMonth = loan.statementDayOfMonth
statementPaymentType = loan.statementPaymentType
maturityDate = loan.maturityDate
additionalProperties = loan.additionalProperties.toMutableMap()
}

Expand Down Expand Up @@ -1133,6 +1131,20 @@ private constructor(
this.gracePeriodDays = gracePeriodDays
}

/** The date on which the loan matures. */
fun maturityDate(maturityDate: LocalDate) = maturityDate(JsonField.of(maturityDate))

/**
* Sets [Builder.maturityDate] to an arbitrary JSON value.
*
* You should usually call [Builder.maturityDate] with a well-typed [LocalDate] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun maturityDate(maturityDate: JsonField<LocalDate>) = apply {
this.maturityDate = maturityDate
}

/** The day of the month on which the loan statement is generated. */
fun statementDayOfMonth(statementDayOfMonth: Long) =
statementDayOfMonth(JsonField.of(statementDayOfMonth))
Expand Down Expand Up @@ -1164,20 +1176,6 @@ private constructor(
this.statementPaymentType = statementPaymentType
}

/** The date on which the loan matures. */
fun maturityDate(maturityDate: LocalDate) = maturityDate(JsonField.of(maturityDate))

/**
* Sets [Builder.maturityDate] to an arbitrary JSON value.
*
* You should usually call [Builder.maturityDate] with a well-typed [LocalDate] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun maturityDate(maturityDate: JsonField<LocalDate>) = apply {
this.maturityDate = maturityDate
}

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand Down Expand Up @@ -1205,20 +1203,17 @@ private constructor(
* The following fields are required:
* ```java
* .creditLimit()
* .gracePeriodDays()
* .statementDayOfMonth()
* .statementPaymentType()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
fun build(): Loan =
Loan(
checkRequired("creditLimit", creditLimit),
checkRequired("gracePeriodDays", gracePeriodDays),
checkRequired("statementDayOfMonth", statementDayOfMonth),
checkRequired("statementPaymentType", statementPaymentType),
gracePeriodDays,
maturityDate,
statementDayOfMonth,
statementPaymentType,
additionalProperties.toMutableMap(),
)
}
Expand All @@ -1241,9 +1236,9 @@ private constructor(

creditLimit()
gracePeriodDays()
statementDayOfMonth()
statementPaymentType().validate()
maturityDate()
statementDayOfMonth()
statementPaymentType().ifPresent { it.validate() }
validated = true
}

Expand All @@ -1265,9 +1260,9 @@ private constructor(
internal fun validity(): Int =
(if (creditLimit.asKnown().isPresent) 1 else 0) +
(if (gracePeriodDays.asKnown().isPresent) 1 else 0) +
(if (maturityDate.asKnown().isPresent) 1 else 0) +
(if (statementDayOfMonth.asKnown().isPresent) 1 else 0) +
(statementPaymentType.asKnown().getOrNull()?.validity() ?: 0) +
(if (maturityDate.asKnown().isPresent) 1 else 0)
(statementPaymentType.asKnown().getOrNull()?.validity() ?: 0)

/** The type of statement payment for the account. */
class StatementPaymentType
Expand Down Expand Up @@ -1444,27 +1439,27 @@ private constructor(
return other is Loan &&
creditLimit == other.creditLimit &&
gracePeriodDays == other.gracePeriodDays &&
maturityDate == other.maturityDate &&
statementDayOfMonth == other.statementDayOfMonth &&
statementPaymentType == other.statementPaymentType &&
maturityDate == other.maturityDate &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy {
Objects.hash(
creditLimit,
gracePeriodDays,
maturityDate,
statementDayOfMonth,
statementPaymentType,
maturityDate,
additionalProperties,
)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Loan{creditLimit=$creditLimit, gracePeriodDays=$gracePeriodDays, statementDayOfMonth=$statementDayOfMonth, statementPaymentType=$statementPaymentType, maturityDate=$maturityDate, additionalProperties=$additionalProperties}"
"Loan{creditLimit=$creditLimit, gracePeriodDays=$gracePeriodDays, maturityDate=$maturityDate, statementDayOfMonth=$statementDayOfMonth, statementPaymentType=$statementPaymentType, additionalProperties=$additionalProperties}"
}

override fun equals(other: Any?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,9 @@ private constructor(
/** Occurs whenever a Physical Check is updated. */
@JvmField val PHYSICAL_CHECK_UPDATED = of("physical_check.updated")

/** Occurs whenever a Plaid Processor Token is created. */
@JvmField val PLAID_PROCESSOR_TOKEN_CREATED = of("plaid_processor_token.created")

/** Occurs whenever a Checkbook is created. */
@JvmField val CHECKBOOK_CREATED = of("checkbook.created")

Expand Down Expand Up @@ -1033,6 +1036,8 @@ private constructor(
PHYSICAL_CHECK_CREATED,
/** Occurs whenever a Physical Check is updated. */
PHYSICAL_CHECK_UPDATED,
/** Occurs whenever a Plaid Processor Token is created. */
PLAID_PROCESSOR_TOKEN_CREATED,
/** Occurs whenever a Checkbook is created. */
CHECKBOOK_CREATED,
/** Occurs whenever a Checkbook is updated. */
Expand Down Expand Up @@ -1308,6 +1313,8 @@ private constructor(
PHYSICAL_CHECK_CREATED,
/** Occurs whenever a Physical Check is updated. */
PHYSICAL_CHECK_UPDATED,
/** Occurs whenever a Plaid Processor Token is created. */
PLAID_PROCESSOR_TOKEN_CREATED,
/** Occurs whenever a Checkbook is created. */
CHECKBOOK_CREATED,
/** Occurs whenever a Checkbook is updated. */
Expand Down Expand Up @@ -1486,6 +1493,7 @@ private constructor(
PHYSICAL_CARD_PROFILE_UPDATED -> Value.PHYSICAL_CARD_PROFILE_UPDATED
PHYSICAL_CHECK_CREATED -> Value.PHYSICAL_CHECK_CREATED
PHYSICAL_CHECK_UPDATED -> Value.PHYSICAL_CHECK_UPDATED
PLAID_PROCESSOR_TOKEN_CREATED -> Value.PLAID_PROCESSOR_TOKEN_CREATED
CHECKBOOK_CREATED -> Value.CHECKBOOK_CREATED
CHECKBOOK_UPDATED -> Value.CHECKBOOK_UPDATED
PROGRAM_CREATED -> Value.PROGRAM_CREATED
Expand Down Expand Up @@ -1636,6 +1644,7 @@ private constructor(
PHYSICAL_CARD_PROFILE_UPDATED -> Known.PHYSICAL_CARD_PROFILE_UPDATED
PHYSICAL_CHECK_CREATED -> Known.PHYSICAL_CHECK_CREATED
PHYSICAL_CHECK_UPDATED -> Known.PHYSICAL_CHECK_UPDATED
PLAID_PROCESSOR_TOKEN_CREATED -> Known.PLAID_PROCESSOR_TOKEN_CREATED
CHECKBOOK_CREATED -> Known.CHECKBOOK_CREATED
CHECKBOOK_UPDATED -> Known.CHECKBOOK_UPDATED
PROGRAM_CREATED -> Known.PROGRAM_CREATED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ private constructor(
/** Occurs whenever a Physical Check is updated. */
@JvmField val PHYSICAL_CHECK_UPDATED = of("physical_check.updated")

/** Occurs whenever a Plaid Processor Token is created. */
@JvmField val PLAID_PROCESSOR_TOKEN_CREATED = of("plaid_processor_token.created")

/** Occurs whenever a Checkbook is created. */
@JvmField val CHECKBOOK_CREATED = of("checkbook.created")

Expand Down Expand Up @@ -1066,6 +1069,8 @@ private constructor(
PHYSICAL_CHECK_CREATED,
/** Occurs whenever a Physical Check is updated. */
PHYSICAL_CHECK_UPDATED,
/** Occurs whenever a Plaid Processor Token is created. */
PLAID_PROCESSOR_TOKEN_CREATED,
/** Occurs whenever a Checkbook is created. */
CHECKBOOK_CREATED,
/** Occurs whenever a Checkbook is updated. */
Expand Down Expand Up @@ -1343,6 +1348,8 @@ private constructor(
PHYSICAL_CHECK_CREATED,
/** Occurs whenever a Physical Check is updated. */
PHYSICAL_CHECK_UPDATED,
/** Occurs whenever a Plaid Processor Token is created. */
PLAID_PROCESSOR_TOKEN_CREATED,
/** Occurs whenever a Checkbook is created. */
CHECKBOOK_CREATED,
/** Occurs whenever a Checkbook is updated. */
Expand Down Expand Up @@ -1524,6 +1531,7 @@ private constructor(
PHYSICAL_CARD_PROFILE_UPDATED -> Value.PHYSICAL_CARD_PROFILE_UPDATED
PHYSICAL_CHECK_CREATED -> Value.PHYSICAL_CHECK_CREATED
PHYSICAL_CHECK_UPDATED -> Value.PHYSICAL_CHECK_UPDATED
PLAID_PROCESSOR_TOKEN_CREATED -> Value.PLAID_PROCESSOR_TOKEN_CREATED
CHECKBOOK_CREATED -> Value.CHECKBOOK_CREATED
CHECKBOOK_UPDATED -> Value.CHECKBOOK_UPDATED
PROGRAM_CREATED -> Value.PROGRAM_CREATED
Expand Down Expand Up @@ -1675,6 +1683,7 @@ private constructor(
PHYSICAL_CARD_PROFILE_UPDATED -> Known.PHYSICAL_CARD_PROFILE_UPDATED
PHYSICAL_CHECK_CREATED -> Known.PHYSICAL_CHECK_CREATED
PHYSICAL_CHECK_UPDATED -> Known.PHYSICAL_CHECK_UPDATED
PLAID_PROCESSOR_TOKEN_CREATED -> Known.PLAID_PROCESSOR_TOKEN_CREATED
CHECKBOOK_CREATED -> Known.CHECKBOOK_CREATED
CHECKBOOK_UPDATED -> Known.CHECKBOOK_UPDATED
PROGRAM_CREATED -> Known.PROGRAM_CREATED
Expand Down
Loading
Loading