From af0cae84344873f4a7cdb63c01564e46a459cf0d Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 16 Aug 2023 17:30:05 +0100 Subject: [PATCH] feat(api)!: change `physical_cards.status` value, remove `event_subscription` field, add fields (#65) change `physical_cards.status` enum value `submitted` to `active`, remove `event_subscription` property `shared_secret`, add `acknowledgement` to `ach_transfer`, add new optional parameter to `get /card_profiles` ## Migration guide If you were referencing the `PhysicalCards.status` property `submitted`, you will now want to reference it as `active` instead. If you were previously using the `sharedSecret` property of `EventSubscription`, you will need to stop using it. --- .../com/increase/api/models/AchTransfer.kt | 181 ++++++++++++++++- .../com/increase/api/models/CardProfile.kt | 10 +- .../api/models/CardProfileListParams.kt | 191 +++++++++++++++++- .../increase/api/models/EventSubscription.kt | 25 +-- .../increase/api/models/AchTransferTest.kt | 5 + .../api/models/CardProfileListParamsTest.kt | 14 ++ .../api/models/EventSubscriptionTest.kt | 2 - 7 files changed, 386 insertions(+), 42 deletions(-) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/AchTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/AchTransfer.kt index c101e082..b16d0dd4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/AchTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/AchTransfer.kt @@ -42,6 +42,7 @@ private constructor( private val statementDescriptor: JsonField, private val status: JsonField, private val submission: JsonField, + private val acknowledgement: JsonField, private val transactionId: JsonField, private val companyDescriptiveDate: JsonField, private val companyDiscretionaryData: JsonField, @@ -131,10 +132,22 @@ private constructor( /** The lifecycle status of the transfer. */ fun status(): Status = status.getRequired("status") - /** After the transfer is submitted to FedACH, this will contain supplemental details. */ + /** + * After the transfer is submitted to FedACH, this will contain supplemental details. Increase + * batches transfers and submits a file to the Federal Reserve roughly every 30 minutes. The + * Federal Reserve processes ACH transfers during weekdays according to their (posted + * schedule)[https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html]. + */ fun submission(): Optional = Optional.ofNullable(submission.getNullable("submission")) + /** + * After the transfer is acknowledged by FedACH, this will contain supplemental details. The + * Federal Reserve sends an acknowledgement message for each file that Increase submits. + */ + fun acknowledgement(): Optional = + Optional.ofNullable(acknowledgement.getNullable("acknowledgement")) + /** The ID for the transaction funding the transfer. */ fun transactionId(): Optional = Optional.ofNullable(transactionId.getNullable("transaction_id")) @@ -260,9 +273,20 @@ private constructor( /** The lifecycle status of the transfer. */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** After the transfer is submitted to FedACH, this will contain supplemental details. */ + /** + * After the transfer is submitted to FedACH, this will contain supplemental details. Increase + * batches transfers and submits a file to the Federal Reserve roughly every 30 minutes. The + * Federal Reserve processes ACH transfers during weekdays according to their (posted + * schedule)[https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html]. + */ @JsonProperty("submission") @ExcludeMissing fun _submission() = submission + /** + * After the transfer is acknowledged by FedACH, this will contain supplemental details. The + * Federal Reserve sends an acknowledgement message for each file that Increase submits. + */ + @JsonProperty("acknowledgement") @ExcludeMissing fun _acknowledgement() = acknowledgement + /** The ID for the transaction funding the transfer. */ @JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId @@ -336,6 +360,7 @@ private constructor( statementDescriptor() status() submission().map { it.validate() } + acknowledgement().map { it.validate() } transactionId() companyDescriptiveDate() companyDiscretionaryData() @@ -377,6 +402,7 @@ private constructor( this.statementDescriptor == other.statementDescriptor && this.status == other.status && this.submission == other.submission && + this.acknowledgement == other.acknowledgement && this.transactionId == other.transactionId && this.companyDescriptiveDate == other.companyDescriptiveDate && this.companyDiscretionaryData == other.companyDiscretionaryData && @@ -413,6 +439,7 @@ private constructor( statementDescriptor, status, submission, + acknowledgement, transactionId, companyDescriptiveDate, companyDiscretionaryData, @@ -432,7 +459,7 @@ private constructor( } override fun toString() = - "AchTransfer{accountId=$accountId, accountNumber=$accountNumber, addendum=$addendum, amount=$amount, currency=$currency, approval=$approval, cancellation=$cancellation, createdAt=$createdAt, externalAccountId=$externalAccountId, id=$id, network=$network, notificationsOfChange=$notificationsOfChange, return_=$return_, routingNumber=$routingNumber, statementDescriptor=$statementDescriptor, status=$status, submission=$submission, transactionId=$transactionId, companyDescriptiveDate=$companyDescriptiveDate, companyDiscretionaryData=$companyDiscretionaryData, companyEntryDescription=$companyEntryDescription, companyName=$companyName, funding=$funding, individualId=$individualId, individualName=$individualName, effectiveDate=$effectiveDate, standardEntryClassCode=$standardEntryClassCode, uniqueIdentifier=$uniqueIdentifier, type=$type, additionalProperties=$additionalProperties}" + "AchTransfer{accountId=$accountId, accountNumber=$accountNumber, addendum=$addendum, amount=$amount, currency=$currency, approval=$approval, cancellation=$cancellation, createdAt=$createdAt, externalAccountId=$externalAccountId, id=$id, network=$network, notificationsOfChange=$notificationsOfChange, return_=$return_, routingNumber=$routingNumber, statementDescriptor=$statementDescriptor, status=$status, submission=$submission, acknowledgement=$acknowledgement, transactionId=$transactionId, companyDescriptiveDate=$companyDescriptiveDate, companyDiscretionaryData=$companyDiscretionaryData, companyEntryDescription=$companyEntryDescription, companyName=$companyName, funding=$funding, individualId=$individualId, individualName=$individualName, effectiveDate=$effectiveDate, standardEntryClassCode=$standardEntryClassCode, uniqueIdentifier=$uniqueIdentifier, type=$type, additionalProperties=$additionalProperties}" companion object { @@ -458,6 +485,7 @@ private constructor( private var statementDescriptor: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var submission: JsonField = JsonMissing.of() + private var acknowledgement: JsonField = JsonMissing.of() private var transactionId: JsonField = JsonMissing.of() private var companyDescriptiveDate: JsonField = JsonMissing.of() private var companyDiscretionaryData: JsonField = JsonMissing.of() @@ -491,6 +519,7 @@ private constructor( this.statementDescriptor = achTransfer.statementDescriptor this.status = achTransfer.status this.submission = achTransfer.submission + this.acknowledgement = achTransfer.acknowledgement this.transactionId = achTransfer.transactionId this.companyDescriptiveDate = achTransfer.companyDescriptiveDate this.companyDiscretionaryData = achTransfer.companyDiscretionaryData @@ -686,14 +715,43 @@ private constructor( @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } - /** After the transfer is submitted to FedACH, this will contain supplemental details. */ + /** + * After the transfer is submitted to FedACH, this will contain supplemental details. + * Increase batches transfers and submits a file to the Federal Reserve roughly every 30 + * minutes. The Federal Reserve processes ACH transfers during weekdays according to their + * (posted + * schedule)[https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html]. + */ fun submission(submission: Submission) = submission(JsonField.of(submission)) - /** After the transfer is submitted to FedACH, this will contain supplemental details. */ + /** + * After the transfer is submitted to FedACH, this will contain supplemental details. + * Increase batches transfers and submits a file to the Federal Reserve roughly every 30 + * minutes. The Federal Reserve processes ACH transfers during weekdays according to their + * (posted + * schedule)[https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html]. + */ @JsonProperty("submission") @ExcludeMissing fun submission(submission: JsonField) = apply { this.submission = submission } + /** + * After the transfer is acknowledged by FedACH, this will contain supplemental details. The + * Federal Reserve sends an acknowledgement message for each file that Increase submits. + */ + fun acknowledgement(acknowledgement: Acknowledgement) = + acknowledgement(JsonField.of(acknowledgement)) + + /** + * After the transfer is acknowledged by FedACH, this will contain supplemental details. The + * Federal Reserve sends an acknowledgement message for each file that Increase submits. + */ + @JsonProperty("acknowledgement") + @ExcludeMissing + fun acknowledgement(acknowledgement: JsonField) = apply { + this.acknowledgement = acknowledgement + } + /** The ID for the transaction funding the transfer. */ fun transactionId(transactionId: String) = transactionId(JsonField.of(transactionId)) @@ -863,6 +921,7 @@ private constructor( statementDescriptor, status, submission, + acknowledgement, transactionId, companyDescriptiveDate, companyDiscretionaryData, @@ -879,6 +938,111 @@ private constructor( ) } + /** + * After the transfer is acknowledged by FedACH, this will contain supplemental details. The + * Federal Reserve sends an acknowledgement message for each file that Increase submits. + */ + @JsonDeserialize(builder = Acknowledgement.Builder::class) + @NoAutoDetect + class Acknowledgement + private constructor( + private val acknowledgedAt: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + private var hashCode: Int = 0 + + /** When the Federal Reserve acknowledged the submitted file containing this transfer. */ + fun acknowledgedAt(): String = acknowledgedAt.getRequired("acknowledged_at") + + /** When the Federal Reserve acknowledged the submitted file containing this transfer. */ + @JsonProperty("acknowledged_at") @ExcludeMissing fun _acknowledgedAt() = acknowledgedAt + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Acknowledgement = apply { + if (!validated) { + acknowledgedAt() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Acknowledgement && + this.acknowledgedAt == other.acknowledgedAt && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = Objects.hash(acknowledgedAt, additionalProperties) + } + return hashCode + } + + override fun toString() = + "Acknowledgement{acknowledgedAt=$acknowledgedAt, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var acknowledgedAt: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(acknowledgement: Acknowledgement) = apply { + this.acknowledgedAt = acknowledgement.acknowledgedAt + additionalProperties(acknowledgement.additionalProperties) + } + + /** + * When the Federal Reserve acknowledged the submitted file containing this transfer. + */ + fun acknowledgedAt(acknowledgedAt: String) = + acknowledgedAt(JsonField.of(acknowledgedAt)) + + /** + * When the Federal Reserve acknowledged the submitted file containing this transfer. + */ + @JsonProperty("acknowledged_at") + @ExcludeMissing + fun acknowledgedAt(acknowledgedAt: JsonField) = apply { + this.acknowledgedAt = acknowledgedAt + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): Acknowledgement = + Acknowledgement(acknowledgedAt, additionalProperties.toUnmodifiable()) + } + } + /** * If your account requires approvals for transfers and the transfer was approved, this will * contain details of the approval. @@ -2687,7 +2851,12 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } - /** After the transfer is submitted to FedACH, this will contain supplemental details. */ + /** + * After the transfer is submitted to FedACH, this will contain supplemental details. Increase + * batches transfers and submits a file to the Federal Reserve roughly every 30 minutes. The + * Federal Reserve processes ACH transfers during weekdays according to their (posted + * schedule)[https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html]. + */ @JsonDeserialize(builder = Submission.Builder::class) @NoAutoDetect class Submission diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfile.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfile.kt index d8536bc3..fdf6c30d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfile.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfile.kt @@ -960,7 +960,7 @@ private constructor( @JvmField val PENDING_SUBMITTING = Status(JsonField.of("pending_submitting")) - @JvmField val SUBMITTED = Status(JsonField.of("submitted")) + @JvmField val ACTIVE = Status(JsonField.of("active")) @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } @@ -970,7 +970,7 @@ private constructor( REJECTED, PENDING_REVIEWING, PENDING_SUBMITTING, - SUBMITTED, + ACTIVE, } enum class Value { @@ -978,7 +978,7 @@ private constructor( REJECTED, PENDING_REVIEWING, PENDING_SUBMITTING, - SUBMITTED, + ACTIVE, _UNKNOWN, } @@ -988,7 +988,7 @@ private constructor( REJECTED -> Value.REJECTED PENDING_REVIEWING -> Value.PENDING_REVIEWING PENDING_SUBMITTING -> Value.PENDING_SUBMITTING - SUBMITTED -> Value.SUBMITTED + ACTIVE -> Value.ACTIVE else -> Value._UNKNOWN } @@ -998,7 +998,7 @@ private constructor( REJECTED -> Known.REJECTED PENDING_REVIEWING -> Known.PENDING_REVIEWING PENDING_SUBMITTING -> Known.PENDING_SUBMITTING - SUBMITTED -> Known.SUBMITTED + ACTIVE -> Known.ACTIVE else -> throw IncreaseInvalidDataException("Unknown Status: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfileListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfileListParams.kt index 0c2902d2..66be49d5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfileListParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/CardProfileListParams.kt @@ -16,6 +16,7 @@ constructor( private val cursor: String?, private val limit: Long?, private val status: Status?, + private val physicalCardsStatus: PhysicalCardsStatus?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { @@ -26,12 +27,18 @@ constructor( fun status(): Optional = Optional.ofNullable(status) + fun physicalCardsStatus(): Optional = + Optional.ofNullable(physicalCardsStatus) + @JvmSynthetic internal fun getQueryParams(): Map> { val params = mutableMapOf>() this.cursor?.let { params.put("cursor", listOf(it.toString())) } this.limit?.let { params.put("limit", listOf(it.toString())) } this.status?.forEachQueryParam { key, values -> params.put("status.$key", values) } + this.physicalCardsStatus?.forEachQueryParam { key, values -> + params.put("physical_cards_status.$key", values) + } params.putAll(additionalQueryParams) return params.toUnmodifiable() } @@ -51,6 +58,7 @@ constructor( this.cursor == other.cursor && this.limit == other.limit && this.status == other.status && + this.physicalCardsStatus == other.physicalCardsStatus && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } @@ -60,13 +68,14 @@ constructor( cursor, limit, status, + physicalCardsStatus, additionalQueryParams, additionalHeaders, ) } override fun toString() = - "CardProfileListParams{cursor=$cursor, limit=$limit, status=$status, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}" + "CardProfileListParams{cursor=$cursor, limit=$limit, status=$status, physicalCardsStatus=$physicalCardsStatus, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}" fun toBuilder() = Builder().from(this) @@ -81,6 +90,7 @@ constructor( private var cursor: String? = null private var limit: Long? = null private var status: Status? = null + private var physicalCardsStatus: PhysicalCardsStatus? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() @@ -89,6 +99,7 @@ constructor( this.cursor = cardProfileListParams.cursor this.limit = cardProfileListParams.limit this.status = cardProfileListParams.status + this.physicalCardsStatus = cardProfileListParams.physicalCardsStatus additionalQueryParams(cardProfileListParams.additionalQueryParams) additionalHeaders(cardProfileListParams.additionalHeaders) } @@ -103,6 +114,10 @@ constructor( fun status(status: Status) = apply { this.status = status } + fun physicalCardsStatus(physicalCardsStatus: PhysicalCardsStatus) = apply { + this.physicalCardsStatus = physicalCardsStatus + } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { this.additionalQueryParams.clear() putAllQueryParams(additionalQueryParams) @@ -148,11 +163,176 @@ constructor( cursor, limit, status, + physicalCardsStatus, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) } + @JsonDeserialize(builder = PhysicalCardsStatus.Builder::class) + @NoAutoDetect + class PhysicalCardsStatus + private constructor( + private val in_: List?, + private val additionalProperties: Map>, + ) { + + private var hashCode: Int = 0 + + /** + * Filter Card Profiles for those with the specified physical card status or statuses. For + * GET requests, this should be encoded as a comma-delimited string, such as + * `?in=one,two,three`. + */ + fun in_(): List? = in_ + + fun _additionalProperties(): Map> = additionalProperties + + @JvmSynthetic + internal fun forEachQueryParam(putParam: (String, List) -> Unit) { + this.in_?.let { putParam("in", listOf(it.joinToString(separator = ","))) } + this.additionalProperties.forEach { key, values -> putParam(key, values) } + } + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PhysicalCardsStatus && + this.in_ == other.in_ && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = Objects.hash(in_, additionalProperties) + } + return hashCode + } + + override fun toString() = + "PhysicalCardsStatus{in_=$in_, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var in_: List? = null + private var additionalProperties: MutableMap> = mutableMapOf() + + @JvmSynthetic + internal fun from(physicalCardsStatus: PhysicalCardsStatus) = apply { + this.in_ = physicalCardsStatus.in_ + additionalProperties(physicalCardsStatus.additionalProperties) + } + + /** + * Filter Card Profiles for those with the specified physical card status or statuses. + * For GET requests, this should be encoded as a comma-delimited string, such as + * `?in=one,two,three`. + */ + fun in_(in_: List) = apply { this.in_ = in_ } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: List) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): PhysicalCardsStatus = + PhysicalCardsStatus(in_?.toUnmodifiable(), additionalProperties.toUnmodifiable()) + } + + class In + @JsonCreator + private constructor( + private val value: JsonField, + ) { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is In && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val NOT_ELIGIBLE = In(JsonField.of("not_eligible")) + + @JvmField val REJECTED = In(JsonField.of("rejected")) + + @JvmField val PENDING_REVIEWING = In(JsonField.of("pending_reviewing")) + + @JvmField val PENDING_SUBMITTING = In(JsonField.of("pending_submitting")) + + @JvmField val ACTIVE = In(JsonField.of("active")) + + @JvmStatic fun of(value: String) = In(JsonField.of(value)) + } + + enum class Known { + NOT_ELIGIBLE, + REJECTED, + PENDING_REVIEWING, + PENDING_SUBMITTING, + ACTIVE, + } + + enum class Value { + NOT_ELIGIBLE, + REJECTED, + PENDING_REVIEWING, + PENDING_SUBMITTING, + ACTIVE, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + NOT_ELIGIBLE -> Value.NOT_ELIGIBLE + REJECTED -> Value.REJECTED + PENDING_REVIEWING -> Value.PENDING_REVIEWING + PENDING_SUBMITTING -> Value.PENDING_SUBMITTING + ACTIVE -> Value.ACTIVE + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + NOT_ELIGIBLE -> Known.NOT_ELIGIBLE + REJECTED -> Known.REJECTED + PENDING_REVIEWING -> Known.PENDING_REVIEWING + PENDING_SUBMITTING -> Known.PENDING_SUBMITTING + ACTIVE -> Known.ACTIVE + else -> throw IncreaseInvalidDataException("Unknown In: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + } + @JsonDeserialize(builder = Status.Builder::class) @NoAutoDetect class Status @@ -164,8 +344,9 @@ constructor( private var hashCode: Int = 0 /** - * Filter Card Profiles for those with the specified status or statuses. For GET requests, - * this should be encoded as a comma-delimited string, such as `?in=one,two,three`. + * Filter Card Profiles for those with the specified digital wallet status or statuses. For + * GET requests, this should be encoded as a comma-delimited string, such as + * `?in=one,two,three`. */ fun in_(): List? = in_ @@ -215,8 +396,8 @@ constructor( } /** - * Filter Card Profiles for those with the specified status or statuses. For GET - * requests, this should be encoded as a comma-delimited string, such as + * Filter Card Profiles for those with the specified digital wallet status or statuses. + * For GET requests, this should be encoded as a comma-delimited string, such as * `?in=one,two,three`. */ fun in_(in_: List) = apply { this.in_ = in_ } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/EventSubscription.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/EventSubscription.kt index 33bacdde..5e8212b3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/EventSubscription.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/EventSubscription.kt @@ -31,7 +31,6 @@ private constructor( private val status: JsonField, private val selectedEventCategory: JsonField, private val url: JsonField, - private val sharedSecret: JsonField, private val type: JsonField, private val additionalProperties: Map, ) { @@ -59,9 +58,6 @@ private constructor( /** The webhook url where we'll send notifications. */ fun url(): String = url.getRequired("url") - /** The key that will be used to sign webhooks. */ - fun sharedSecret(): String = sharedSecret.getRequired("shared_secret") - /** * A constant representing the object's type. For this resource it will always be * `event_subscription`. @@ -88,9 +84,6 @@ private constructor( /** The webhook url where we'll send notifications. */ @JsonProperty("url") @ExcludeMissing fun _url() = url - /** The key that will be used to sign webhooks. */ - @JsonProperty("shared_secret") @ExcludeMissing fun _sharedSecret() = sharedSecret - /** * A constant representing the object's type. For this resource it will always be * `event_subscription`. @@ -108,7 +101,6 @@ private constructor( status() selectedEventCategory() url() - sharedSecret() type() validated = true } @@ -127,7 +119,6 @@ private constructor( this.status == other.status && this.selectedEventCategory == other.selectedEventCategory && this.url == other.url && - this.sharedSecret == other.sharedSecret && this.type == other.type && this.additionalProperties == other.additionalProperties } @@ -141,7 +132,6 @@ private constructor( status, selectedEventCategory, url, - sharedSecret, type, additionalProperties, ) @@ -150,7 +140,7 @@ private constructor( } override fun toString() = - "EventSubscription{id=$id, createdAt=$createdAt, status=$status, selectedEventCategory=$selectedEventCategory, url=$url, sharedSecret=$sharedSecret, type=$type, additionalProperties=$additionalProperties}" + "EventSubscription{id=$id, createdAt=$createdAt, status=$status, selectedEventCategory=$selectedEventCategory, url=$url, type=$type, additionalProperties=$additionalProperties}" companion object { @@ -164,7 +154,6 @@ private constructor( private var status: JsonField = JsonMissing.of() private var selectedEventCategory: JsonField = JsonMissing.of() private var url: JsonField = JsonMissing.of() - private var sharedSecret: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -175,7 +164,6 @@ private constructor( this.status = eventSubscription.status this.selectedEventCategory = eventSubscription.selectedEventCategory this.url = eventSubscription.url - this.sharedSecret = eventSubscription.sharedSecret this.type = eventSubscription.type additionalProperties(eventSubscription.additionalProperties) } @@ -227,16 +215,6 @@ private constructor( @ExcludeMissing fun url(url: JsonField) = apply { this.url = url } - /** The key that will be used to sign webhooks. */ - fun sharedSecret(sharedSecret: String) = sharedSecret(JsonField.of(sharedSecret)) - - /** The key that will be used to sign webhooks. */ - @JsonProperty("shared_secret") - @ExcludeMissing - fun sharedSecret(sharedSecret: JsonField) = apply { - this.sharedSecret = sharedSecret - } - /** * A constant representing the object's type. For this resource it will always be * `event_subscription`. @@ -272,7 +250,6 @@ private constructor( status, selectedEventCategory, url, - sharedSecret, type, additionalProperties.toUnmodifiable(), ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/AchTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/AchTransferTest.kt index e42fc129..afab6e77 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/AchTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/AchTransferTest.kt @@ -14,6 +14,9 @@ class AchTransferTest { .id("string") .accountId("string") .accountNumber("string") + .acknowledgement( + AchTransfer.Acknowledgement.builder().acknowledgedAt("string").build() + ) .addendum("string") .amount(123L) .approval( @@ -82,6 +85,8 @@ class AchTransferTest { assertThat(achTransfer.id()).isEqualTo("string") assertThat(achTransfer.accountId()).isEqualTo("string") assertThat(achTransfer.accountNumber()).isEqualTo("string") + assertThat(achTransfer.acknowledgement()) + .contains(AchTransfer.Acknowledgement.builder().acknowledgedAt("string").build()) assertThat(achTransfer.addendum()).contains("string") assertThat(achTransfer.amount()).isEqualTo(123L) assertThat(achTransfer.approval()) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/CardProfileListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/CardProfileListParamsTest.kt index c2665b18..5895c18e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/CardProfileListParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/CardProfileListParamsTest.kt @@ -16,6 +16,11 @@ class CardProfileListParamsTest { .in_(listOf(CardProfileListParams.Status.In.PENDING)) .build() ) + .physicalCardsStatus( + CardProfileListParams.PhysicalCardsStatus.builder() + .in_(listOf(CardProfileListParams.PhysicalCardsStatus.In.NOT_ELIGIBLE)) + .build() + ) .build() } @@ -30,6 +35,11 @@ class CardProfileListParamsTest { .in_(listOf(CardProfileListParams.Status.In.PENDING)) .build() ) + .physicalCardsStatus( + CardProfileListParams.PhysicalCardsStatus.builder() + .in_(listOf(CardProfileListParams.PhysicalCardsStatus.In.NOT_ELIGIBLE)) + .build() + ) .build() val expected = mutableMapOf>() expected.put("cursor", listOf("string")) @@ -38,6 +48,10 @@ class CardProfileListParamsTest { .in_(listOf(CardProfileListParams.Status.In.PENDING)) .build() .forEachQueryParam { key, values -> expected.put("status.$key", values) } + CardProfileListParams.PhysicalCardsStatus.builder() + .in_(listOf(CardProfileListParams.PhysicalCardsStatus.In.NOT_ELIGIBLE)) + .build() + .forEachQueryParam { key, values -> expected.put("physical_cards_status.$key", values) } assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/EventSubscriptionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/EventSubscriptionTest.kt index 5f1eb2ee..64420804 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/EventSubscriptionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/EventSubscriptionTest.kt @@ -13,7 +13,6 @@ class EventSubscriptionTest { .id("string") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .selectedEventCategory(EventSubscription.SelectedEventCategory.ACCOUNT_CREATED) - .sharedSecret("string") .status(EventSubscription.Status.ACTIVE) .type(EventSubscription.Type.EVENT_SUBSCRIPTION) .url("string") @@ -24,7 +23,6 @@ class EventSubscriptionTest { .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(eventSubscription.selectedEventCategory()) .contains(EventSubscription.SelectedEventCategory.ACCOUNT_CREATED) - assertThat(eventSubscription.sharedSecret()).isEqualTo("string") assertThat(eventSubscription.status()).isEqualTo(EventSubscription.Status.ACTIVE) assertThat(eventSubscription.type()).isEqualTo(EventSubscription.Type.EVENT_SUBSCRIPTION) assertThat(eventSubscription.url()).isEqualTo("string")