Skip to content

Commit

Permalink
feat(api): updates (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed May 29, 2024
1 parent 6bcc218 commit 687ed93
Show file tree
Hide file tree
Showing 26 changed files with 2,507 additions and 2,406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@ import com.lithic.api.core.toUnmodifiable
import java.util.Objects
import java.util.Optional

/**
* Address used during Address Verification Service (AVS) checks during transactions if enabled via
* Auth Rules.
*/
@JsonDeserialize(builder = ExternalBankAccountAddress.Builder::class)
@NoAutoDetect
class ExternalBankAccountAddress
private constructor(
private val address1: JsonField<String>,
private val address2: JsonField<String>,
private val city: JsonField<String>,
private val country: JsonField<String>,
private val postalCode: JsonField<String>,
private val state: JsonField<String>,
private val postalCode: JsonField<String>,
private val country: JsonField<String>,
private val additionalProperties: Map<String, JsonValue>,
) {

Expand All @@ -42,23 +38,23 @@ private constructor(

fun city(): String = city.getRequired("city")

fun country(): String = country.getRequired("country")
fun state(): String = state.getRequired("state")

fun postalCode(): String = postalCode.getRequired("postal_code")

fun state(): String = state.getRequired("state")
fun country(): String = country.getRequired("country")

@JsonProperty("address1") @ExcludeMissing fun _address1() = address1

@JsonProperty("address2") @ExcludeMissing fun _address2() = address2

@JsonProperty("city") @ExcludeMissing fun _city() = city

@JsonProperty("country") @ExcludeMissing fun _country() = country
@JsonProperty("state") @ExcludeMissing fun _state() = state

@JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode

@JsonProperty("state") @ExcludeMissing fun _state() = state
@JsonProperty("country") @ExcludeMissing fun _country() = country

@JsonAnyGetter
@ExcludeMissing
Expand All @@ -69,9 +65,9 @@ private constructor(
address1()
address2()
city()
country()
postalCode()
state()
postalCode()
country()
validated = true
}
}
Expand All @@ -87,9 +83,9 @@ private constructor(
this.address1 == other.address1 &&
this.address2 == other.address2 &&
this.city == other.city &&
this.country == other.country &&
this.postalCode == other.postalCode &&
this.state == other.state &&
this.postalCode == other.postalCode &&
this.country == other.country &&
this.additionalProperties == other.additionalProperties
}

Expand All @@ -100,17 +96,17 @@ private constructor(
address1,
address2,
city,
country,
postalCode,
state,
postalCode,
country,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"ExternalBankAccountAddress{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}"
"ExternalBankAccountAddress{address1=$address1, address2=$address2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}"

companion object {

Expand All @@ -122,19 +118,19 @@ private constructor(
private var address1: JsonField<String> = JsonMissing.of()
private var address2: JsonField<String> = JsonMissing.of()
private var city: JsonField<String> = JsonMissing.of()
private var country: JsonField<String> = JsonMissing.of()
private var postalCode: JsonField<String> = JsonMissing.of()
private var state: JsonField<String> = JsonMissing.of()
private var postalCode: JsonField<String> = JsonMissing.of()
private var country: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(externalBankAccountAddress: ExternalBankAccountAddress) = apply {
this.address1 = externalBankAccountAddress.address1
this.address2 = externalBankAccountAddress.address2
this.city = externalBankAccountAddress.city
this.country = externalBankAccountAddress.country
this.postalCode = externalBankAccountAddress.postalCode
this.state = externalBankAccountAddress.state
this.postalCode = externalBankAccountAddress.postalCode
this.country = externalBankAccountAddress.country
additionalProperties(externalBankAccountAddress.additionalProperties)
}

Expand All @@ -156,23 +152,23 @@ private constructor(
@ExcludeMissing
fun city(city: JsonField<String>) = apply { this.city = city }

fun country(country: String) = country(JsonField.of(country))
fun state(state: String) = state(JsonField.of(state))

@JsonProperty("country")
@JsonProperty("state")
@ExcludeMissing
fun country(country: JsonField<String>) = apply { this.country = country }
fun state(state: JsonField<String>) = apply { this.state = state }

fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode))

@JsonProperty("postal_code")
@ExcludeMissing
fun postalCode(postalCode: JsonField<String>) = apply { this.postalCode = postalCode }

fun state(state: String) = state(JsonField.of(state))
fun country(country: String) = country(JsonField.of(country))

@JsonProperty("state")
@JsonProperty("country")
@ExcludeMissing
fun state(state: JsonField<String>) = apply { this.state = state }
fun country(country: JsonField<String>) = apply { this.country = country }

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
Expand All @@ -193,9 +189,9 @@ private constructor(
address1,
address2,
city,
country,
postalCode,
state,
postalCode,
country,
additionalProperties.toUnmodifiable(),
)
}
Expand Down
Loading

0 comments on commit 687ed93

Please sign in to comment.