com.lithic.api.models.AuthRuleRemoveResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lithic-kotlin-core Show documentation
Show all versions of lithic-kotlin-core Show documentation
The Lithic Developer API is designed to provide a predictable programmatic
interface for accessing your Lithic account through an API and transaction
webhooks. Note that your API key is a secret and should be treated as such.
Don't share it with anyone, including us. We will never ask you for it.
// File generated from our OpenAPI spec by Stainless.
package com.lithic.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.lithic.api.core.ExcludeMissing
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.toUnmodifiable
import java.util.Objects
@JsonDeserialize(builder = AuthRuleRemoveResponse.Builder::class)
@NoAutoDetect
class AuthRuleRemoveResponse
private constructor(
private val accountTokens: JsonField>,
private val cardTokens: JsonField>,
private val programLevel: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun accountTokens(): List? = accountTokens.getNullable("account_tokens")
fun cardTokens(): List? = cardTokens.getNullable("card_tokens")
fun programLevel(): Boolean? = programLevel.getNullable("program_level")
@JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens
@JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens
@JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AuthRuleRemoveResponse = apply {
if (!validated) {
accountTokens()
cardTokens()
programLevel()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AuthRuleRemoveResponse &&
this.accountTokens == other.accountTokens &&
this.cardTokens == other.cardTokens &&
this.programLevel == other.programLevel &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountTokens,
cardTokens,
programLevel,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AuthRuleRemoveResponse{accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var accountTokens: JsonField> = JsonMissing.of()
private var cardTokens: JsonField> = JsonMissing.of()
private var programLevel: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(authRuleRemoveResponse: AuthRuleRemoveResponse) = apply {
this.accountTokens = authRuleRemoveResponse.accountTokens
this.cardTokens = authRuleRemoveResponse.cardTokens
this.programLevel = authRuleRemoveResponse.programLevel
additionalProperties(authRuleRemoveResponse.additionalProperties)
}
fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens))
@JsonProperty("account_tokens")
@ExcludeMissing
fun accountTokens(accountTokens: JsonField>) = apply {
this.accountTokens = accountTokens
}
fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens))
@JsonProperty("card_tokens")
@ExcludeMissing
fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens }
fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel))
@JsonProperty("program_level")
@ExcludeMissing
fun programLevel(programLevel: JsonField) = apply {
this.programLevel = programLevel
}
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(): AuthRuleRemoveResponse =
AuthRuleRemoveResponse(
accountTokens.map { it.toUnmodifiable() },
cardTokens.map { it.toUnmodifiable() },
programLevel,
additionalProperties.toUnmodifiable(),
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy